I rebase another branch onto my checkout branch and I get a conflict during rebase. i resolved the merge conflict.
$ git status
rebase in progress; onto 77c951b
You are currently rebasing branch 'test' on '77c951b'.
(all conflicts fixed: run "git rebase --continue")
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: br_boss_buha_faktura/forms/br_boss_buha_faktura_head_dtl.frm
modified: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client.val
new file: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client_name.val
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client.val
Do I need to commit the above resolved merge conflict git commit
or can I directly go further using git rebase --continue
?
If there were uncommitted worktree changes present when the merge started, git merge --abort will in some cases be unable to reconstruct these changes. It is therefore recommended to always commit or stash your changes before running git merge.
The purpose of rebase is make your commits look as if they were changes to the branch you rebase onto. So the most logical way is to incorporate merge conflicts into these commits. No additional commits is required thus.
Some good answers here but to answer the question. NO you do not need to commit after resolving the merge conflict.
Once you have added the resolution to the git staging area via git add <file>
a git rebase --continue
will make the commit for you using the original commit message.
NOTE the commit hash will change! So when you go to merge this into another branch that has commits that you altered in your branch you will have issues merging those branches together.
NOTE I said you do not need to git commit
after resolving a git rebase
conflict, but you can if you want to.
It may be useful to split files from one commit into a series of individual commits if it makes more sense. Usually you just want to resolve the conflict though. As is shown here: Break a previous commit into multiple commits.
If you DO commit your changes, I believe that you can do a git rebase --skip
to skip over the now non-existent merge conflict.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With