git - 在 Git rebase 期间解决 merge 冲突后是否需要提交?

标签 git git-branch git-merge git-rebase

我将另一个分支 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/

相关文章:

git - git hooks如何在不同的操作系统上提供参数

git - merge Git 存储库中的两个远程分支

git push 到远程分支

git - 如何将文件从master分支推送到另一个分支?

git - git 快进 merge 是否会更改 merge 提交的 SHA?

linux - sftp 上传 bash 忽略文件

git - 由于 Adob​​e Brackets 中的 Git 而丢失所有文件

git rm --cached 不工作

git cherry 采摘到不同的基本目录

git - 查找 merge 提交可以撤消分支之一的先前更改?