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

git save history of resolved merge conflicts

在我们的存储库中,我们有两个分支已经分叉了一段时间,我需要将它们重新合并在一起。显然会有很多冲突,希望是小的...

(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".

我想以某种方式保存需要解决的冲突和我对它们的解决方案,以便我可以将它们作为代码审查与团队共享,以便我们可以确保在合并中正确完成所有事情.有什么好的方法吗?

看看git rerere. You may also want to see the SO question Sharing rerere cache

在您解决合并冲突之后但在提交您的解决方案之前,git rerere diff 将向您显示将被记录的解决方案。已提交的决议存储在 .git/rr-cache