According to the docs https://www.conventionalcommits.org/en/v1.0.0/ or to another extendable source if I have a merge conflict what a commit type should I use?
Conventional Commits type for merge conflicts
2.3k Views Asked by Stepan At
1
There are 1 best solutions below
Related Questions in GIT
- problem to push files on a repository git
- diff3 output in git conflict style, including mergeable hunks
- Git Not In Sync with Local Branch
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- How to fix overriding the main branch in Git?
- I can't add text to "Message" in VS Code when committing to Git
- How can i redirect pull request from main branch to another branch
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Git/TortoiseGit : how to apply ONLY the changes from ONE commit from branch A, to branch B?
- How can I reintroduce username an password on git using fedora?
- GIT SKIP EMPTY DIRECTORIES
- Git smudge run once per checkout or per commit?
- I can't find ~/.profile or ~/.bashrc in C:/Users/<user>/.ssh folder
- Set environment variable during push for GitHub Actions
- Android WebRTC compile
Related Questions in CONVENTIONAL-COMMITS
- Generating a changelog with conventional-changelog-writer?
- Conventional commit type for library version bump
- What is the recommended way to add emoji's to commitizen config
- Conventional Commit type when upgrading a library dependency
- Is it possible to make cz-customizable questions required?
- Including issue code in the commit message header according to Conventional Commits
- Prevent Lerna from making breaking version updates
- When should you update release notes/changelogs?
- Prevent trigger recursion when using automatic changelog with standard version in azure pipeline
- Conventional commits when to use Fix vs Feat
- what is the difference between a simple commit and conventional commit
- Flutter and Automatic Versioning
- Lexing token ambiguity in ANTLR4
- Commit type according to convensional commit when resolving conflicts
- Conventional commits. How to avoid fixes in release notes during feature development
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I cannot find all the sources that I had read on that topic, but it seems many Conventional Commit users do not use merge commits, and instead rebase their branch to fix conflicts before merging with
--ff-only.See Commit type according to convensional commit when resolving conflicts
I believe the approach would be that for each conflict, you would need to figure out to which of your commits the fix would belong. For example, if you have a commit that refactored some code and someone fixed a bug in the same area, you would squash that conflict fix into the
refactorcommit. The idea is to make the history look linear as if your branch introduces changes on top of the previous one, not parallelly.The idea would be as follows:
git checkout <my-branch>, thengit rebase main(if merging into main)git rebasewill stop at any commit that causes the conflict. After fixing the conflicts, you can either directly amend the current commit (if it is the one that makes the most sense to add changes to) viagit commit --amend, or create new commits that you can link to existing ones withgit commit --fixup <commit-hash>. These commits can later be squashed into the one it has been linked to. Then,git rebase --continue.git rebase -i --autosquash main. This squashes the fixup commits into their “linked” ones.git checkout mainandgit merge --ff-only <my-branch>. The option means it will only merge if it can do so by fast-forwarding (just moving the branch tip to that commit without conflicts), which it should as your rebase took care of recreating the commits on top with conflicts handled.