Reputation: 302987
In our repository, we have two branches that have been diverging for some time now and I need to merge them back together. There will obviously be lots of conflicts, hopefully minor...
(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".
I would like to somehow save the conflicts that need to be resolved and my resolutions of them, so that I could share them with the team as a code review so that we could ensure that everything was done correctly in the merge. Is there a good way to do that?
Upvotes: 6
Views: 2664
Reputation: 1627
Take a look at git rerere. You may also want to see the SO question Sharing rerere cache.
After you resolve merge conflicts but before you commit your resolution, git rerere diff
will show you the resolution that will be recorded. Resolutions that have been committed are stored in .git/rr-cache
Upvotes: 8