I'm using git-rerere
for its intended purpose, to record conflict resolutions between two branches (master and a topic branch) incrementally as those branches develop, without creating unnecessary merge commits. However, even after reading the git-rerere manpage I'm a little unclear on when rerere actually records my conflict resolution. My standard workflow for detecting and resolving new merge conflicts is to do git merge master
from the topic branch, resolve the conflicts, then stage all the files and commit the merge with git commit -m "Finished test merge"
, and then undo the merge using git reset --hard HEAD^
, leaving behind only the recorded resolutions stored by git-rerere
.
However, this seems a bit silly. Creating a commit and then undoing it just to record the resolution? After reading the manpage for git-rerere
, I'm still not really clear on when it records my resolutions. Is it sufficient to just stage the conflicted files or do I actually need to create the merge commit after resolving the conflicts, like I've been doing?
From the manpage:
And:
So you don't have to commit and undo the commit. You can just run
git rerere
without parameters to record the commit.