Git’s rerere feature can remember a manual merge-conflict resolution and reuse it when a matching conflict appears again. Enable it with rerere.enabled, then inspect the reused change and stage it yourself: by default, rerere updates the working tree but not the index.
What Git rerere remembers—and when it helps
rerere stands for “reuse recorded resolution.” The feature records a conflicted automerge and the corresponding manual fix. If Git later encounters a matching conflict, it tries to apply that saved fix. This is especially useful on long-lived topic branches, where you may resolve the same conflict repeatedly while testing, rebasing, and integrating work. See the Git rerere manual.
As an Amazon Associate I earn from qualifying purchases.
Rerere learns from a resolution you make; it is not a general-purpose merge strategy and does not decide whether an old fix still suits the current code or intent.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11How rerere applies a saved resolution
On the first occurrence, Git encounters a conflicted automerge with conflict markers. After you resolve it, rerere records both the conflicted content and your resolution. When a matching conflict occurs later, Git performs a three-way merge using the earlier conflicted automerge, your earlier resolution, and the current conflicted automerge. If that merge is clean, Git writes the result into the working tree.
#1 Best Overall
Git normalizes conflict markers and hunk order when calculating a conflict ID, which helps matching work despite changes in conflict labels, marker style, or merge order. Details are in the Git rerere technical documentation.
Enable rerere
Enable it globally to use it across repositories, or set it in a repository’s local configuration:
# Enable for all repositories for the current user
git config --global rerere.enabled true
# Or enable only in the current repository
git config rerere.enabled true
Once enabled, Git’s merge and rebase workflows can invoke rerere when a matching conflict occurs.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
Review and stage every reused resolution
By default, rerere leaves the index unchanged. A cleanly reused fix can therefore appear in your working tree without being staged. Inspect the result in context before accepting it; a resolution that was right earlier may be wrong after surrounding code or requirements have changed.
-
Check which paths have resolutions rerere will record with
git rerere status. -
See which conflicts remain unresolved with
git rerere remaining. -
Review resolution changes with
git rerere diff, then inspect the working-tree change usinggit difforgit diff -c.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
When the result is correct, stage the path with
git add <path>.
The default and opt-in index behaviors differ:
| Setting | Effect | What to do |
|---|---|---|
rerere.autoUpdate=false (documented default) |
A cleanly reused resolution updates the working tree, not the index. | Review the result, then stage it yourself. |
rerere.autoUpdate=true |
A cleanly reused resolution also updates the index. | Review the result even though it is staged; correct or unstage it if needed. |
Git documents these options in its git-config manual. Automatic staging changes index behavior, not the need to verify the resolution.
Rank #4
Manage saved resolutions and their retention
Use these commands when a recorded fix needs attention or old records should be cleaned up:
git rerere forget <pathspec>resets recorded resolutions for current matching conflicts in the specified paths.git rerere clearresets rerere metadata when abandoning a merge resolution. Git notes thatgit amandgit rebaseskip or abort flows invoke it automatically.git rerere gcprunes old records. The documented defaults retain unresolved records for 15 days and resolved records for 60 days; configure those periods withgc.rerereUnresolvedandgc.rerereResolved, respectively.
The retention periods are configuration defaults documented by Git, not guarantees that records will remain indefinitely. Refer to the Git configuration documentation for the relevant settings.
Where rerere can fail or be misleading
-
Changed context or intent: A technically clean reuse can still be semantically wrong. Review the resulting diff and surrounding code before committing.
Best Value
-
Content that resembles conflict markers: Rerere relies on marker lines to identify conflicts. Ordinary file content that looks like those markers can interfere with recording; Git points to the
conflict-marker-sizegitattributes setting as a workaround. -
Conflicting submodules: Git identifies conflicting submodules as an example of conflicts rerere cannot autoresolve.
These limitations and the recommended diff checks are described in the Git rerere manual.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




