table of contents
other versions
- jessie 1:2.1.4-2.1+deb8u6
- jessie-backports 1:2.11.0-3~bpo8+1
- stretch 1:2.11.0-3+deb9u4
- testing 1:2.20.1-2
- stretch-backports 1:2.20.1-1~bpo9+1
- unstable 1:2.20.1-2
- experimental 1:2.21.0+next.20190320-1
| GIT-RERERE(1) | Git Manual | GIT-RERERE(1) |
NAME¶
git-rerere - Reuse recorded resolution of conflicted mergesSYNOPSIS¶
git rerere [clear|forget <pathspec>|diff|remaining|status|gc]
DESCRIPTION¶
In a workflow employing relatively long lived topic branches, the developer sometimes needs to resolve the same conflicts over and over again until the topic branches are done (either merged to the "release" branch, or sent out and accepted upstream). This command assists the developer in this process by recording conflicted automerge results and corresponding hand resolve results on the initial manual merge, and applying previously recorded hand resolutions to their corresponding automerge results.COMMANDS¶
Normally, git rerere is run without arguments or user-intervention. However, it has several commands that allow it to interact with its working state. clearReset the metadata used by rerere if a merge resolution
is to be aborted. Calling git am [--skip|--abort] or git rebase
[--skip|--abort] will automatically invoke this command.
forget <pathspec>
Reset the conflict resolutions which rerere has recorded
for the current conflict in <pathspec>.
diff
Display diffs for the current state of the resolution. It
is useful for tracking what has changed while the user is resolving conflicts.
Additional arguments are passed directly to the system diff command
installed in PATH.
status
Print paths with conflicts whose merge resolution rerere
will record.
remaining
Print paths with conflicts that have not been
autoresolved by rerere. This includes paths whose resolutions cannot be
tracked by rerere, such as conflicting submodules.
gc
Prune records of conflicted merges that occurred a long
time ago. By default, unresolved conflicts older than 15 days and resolved
conflicts older than 60 days are pruned. These defaults are controlled via the
gc.rerereUnresolved and gc.rerereResolved configuration
variables respectively.
DISCUSSION¶
When your topic branch modifies an overlapping area that your master branch (or upstream) touched since your topic branch forked from it, you may want to test it with the latest master, even before your topic branch is ready to be pushed upstream: o---*---o topic
/
o---o---o---*---o---o master
$ git checkout topic
$ git merge master
o---*---o---+ topic
/ /
o---o---o---*---o---o master
$ git checkout topic
$ git merge master
$ ... work on both topic and master branches
$ git checkout master
$ git merge topic
o---*---o---+---o---o topic
/ / \
o---o---o---*---o---o---o---o---+ master
$ git checkout topic
$ git merge master
$ git reset --hard HEAD^ ;# rewind the test merge
$ ... work on both topic and master branches
$ git checkout master
$ git merge topic
o---*---o-------o---o topic
/ \
o---o---o---*---o---o---o---o---+ master
o---*---o-------o---o topic
/
o---o---o---*---o---o---o---o master
$ git rebase master topic
o---*---o-------o---o topic
/
o---o---o---*---o---o---o---o master
GIT¶
Part of the git(1) suite| 05/15/2017 | Git 2.11.0 |