Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Git’s rerere feature can remember a manual merge-conflict resolution and apply it when a matching conflict appears again. Enable it with rerere.enabled, then inspect the reused change before staging it: by default, rerere updates the working tree but leaves the index alone.

What Git rerere remembers—and when it helps

rerere stands for “reuse recorded resolution.” During a conflicted merge, Git records the conflict and, after you resolve it, the corresponding manual fix. If a matching conflict occurs later, Git tries to reuse that fix. The feature is especially useful on long-lived topic branches where repeated testing or later integration can produce the same conflict again. Git’s rerere manual

It does not decide whether an old fix is still correct for the code’s current meaning. Treat a reused resolution as a proposed change, not approval to commit.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable rerere

To enable conflict recording for all repositories belonging to your user account, run:

git config --global rerere.enabled true

To enable it only in the current repository, omit --global:

git config rerere.enabled true

Once enabled, Git invokes rerere during merge and rebase workflows. It records a resolution after you resolve the conflict; it cannot learn a useful fix until you have resolved one manually.

Review and stage a reused resolution

By default, rerere writes a cleanly reused resolution to the working tree but does not update the index. Review the change, then stage the path only if the result is correct:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Check which paths have resolutions rerere will record with git rerere status.

  2. See conflicts that rerere did not resolve with git rerere remaining.

  3. Inspect resolution changes with git rerere diff.

  4. Review the working-tree change with git diff or, where useful for a conflicted merge, git diff -c.

  5. After confirming the fix, stage the appropriate path, for example git add path/to/file.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Git documents rerere.autoUpdate as false by default. If you explicitly set it to true, rerere updates the index after a clean reuse:

git config rerere.autoUpdate true

Automatic index updates remove the manual staging step, not the need to inspect the result. Git configuration reference

How reuse works

On the initial conflict, Git records the conflicted automerge, including its conflict markers. Once you resolve it, Git records the result. On a later matching conflict, rerere performs a three-way merge using the original conflicted automerge, your recorded resolution, and the current conflicted automerge. If that merge is clean, it writes the result into the working tree. Git rerere manual

Git normalizes conflict markers and hunk order when calculating a conflict ID. That helps it match conflicts even when labels, conflict style, or merge order have changed. Git rerere technical documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Forget or clear recorded resolutions

If a saved resolution is no longer appropriate for a current conflict, forget it for the matching path or paths:

git rerere forget path/to/file

Use git rerere clear to reset rerere metadata when abandoning a merge resolution. Git’s git am and git rebase skip or abort flows invoke this cleanup automatically. Git rerere manual

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Retention and limitations

When git rerere gc runs, Git’s documented defaults retain unresolved conflict records for 15 days and resolved records for 60 days. The periods are configurable through gc.rerereUnresolved and gc.rerereResolved; they describe retention after garbage collection, not a promise that every record disappears on an exact schedule. Git configuration reference

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.