我将另一个分支 rebase 到我的 checkout 分支上,并且在 rebase 期间发生冲突。我解决了 merge 冲突。
$ 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
我是否需要提交上述已解决的 merge 冲突git commit
,或者我是否可以直接使用git rebase --continue
继续下去?
最佳答案
这里有一些很好的答案,但要回答这个问题。 否您不需要在解决 merge 冲突后提交。
通过git add <file>
将解决方案添加到git暂存区后一个git rebase --continue
将使用原始提交消息为您提交。
注意 提交哈希会改变!因此,当您将其 merge 到另一个分支中,该分支具有您在分支中更改的提交时,您将在将这些分支 merge 在一起时遇到问题。
注意 我说过你不需要 git commit
在解决 git rebase
之后冲突,但如果您愿意,您可以。
如果更有意义,将文件从一次提交拆分为一系列单独的提交可能会很有用。通常你只是想解决冲突。如此处所示:Break a previous commit into multiple commits .
关于git - 在 Git rebase 期间解决 merge 冲突后是否需要提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26115157/