Git保存已解决合并冲突的历史记录。

6

在我们的代码库中,有两个分支已经存在较长时间并且开始分叉了。我需要将它们合并回来。显然会有很多冲突,但希望这些冲突都是小问题...

(foo )$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: some_commit1
Applying: some_commit2
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging some_file.xyz
CONFLICT (content): Merge conflict in some_file.xyz
Failed to merge in the changes.
Patch failed at 0002 some_commit2

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

我希望能够保存需要解决的冲突及其解决方案,这样我就可以将它们分享给团队进行代码审查,以确保在合并时一切都被正确处理。有什么好的方法可以做到这一点吗?

1个回答

8
请查看git rerere。你也可以查看SO问题共享rerere缓存
在解决合并冲突之后,但在提交解决方案之前,git rerere diff会显示将记录的解决方案。已提交的解决方案存储在.git/rr-cache中。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接