table of contents
other versions
- wheezy 1:1.7.10.4-1+wheezy3
- wheezy-backports 1:1.9.1-1~bpo70+2
- jessie 1:2.1.4-2.1+deb8u2
- jessie-backports 1:2.11.0-3~bpo8+1
- testing 1:2.11.0-3
- unstable 1:2.11.0-4
- experimental 1:2.13.1+next.20170610-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).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| 04/08/2014 | Git 1.9.1 |