DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

Git Remembers How You Resolved That Conflict—If You Let It

Git rerere can reuse a hand-resolved conflict when a matching conflict returns—but you still need to review, test, and stage the result.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes: Git can reuse a hand-resolved merge conflict when a sufficiently similar conflict appears again. Turn on rerere (“reuse recorded resolution”) with git config --global rerere.enabled true. When Git applies a saved resolution, review and test the result before staging it: by default, rerere updates the working tree but leaves the index alone.

What rerere remembers—and when it helps

Rerere records a conflicted automatic merge and the corresponding resolution you make by hand. If a matching conflict occurs later, Git can apply that saved resolution. The Git project’s git-rerere manual describes this as recording conflicted auto-merge results and their hand resolutions, then applying previously recorded resolutions to corresponding auto-merge results.

As an Amazon Associate I earn from qualifying purchases.

It is most useful when the same conflict recurs during repeated merges or rebases. For example, a developer may periodically merge a moving upstream branch into a long-lived topic branch to test it. After resolving a conflict during one test merge, rerere can reuse that work when the topic branch is tested again or finally integrated. Git’s Pro Git guide to maintaining a project describes this kind of workflow.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Rerere is not a general-purpose code understanding feature. It can recognize a recurring conflict shape and apply the earlier choice, but it cannot tell whether that choice still makes sense after the surrounding code or requirements change.

Enable rerere

To enable recording for your user across repositories, run:

git config --global rerere.enabled true

To limit the setting to the repository you are in, omit --global:

git config rerere.enabled true

With the setting enabled, Git invokes rerere in merge and rebase conflict workflows. You can also run git rerere directly. The Git project’s git-config documentation notes that rerere is enabled by default if an rr-cache directory already exists under $GIT_DIR.

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

Review a reused resolution before staging

A saved resolution is a proposed edit, not an approval. After Git applies it, inspect the working-tree changes, check for whitespace errors, run the relevant project tests, and stage the file yourself when satisfied:

git diff
git diff --check
# Run the project's relevant tests and review the behavior
git add <file>

The Git project’s git-rerere manual explicitly says that rerere leaves the index alone, so you still need final sanity checks with git diff (or git diff -c) and git add once satisfied.

The rerere.autoUpdate setting changes that behavior: when true, a cleanly reused result also updates the index. Its documented default is false. Keeping the default supports a deliberate review-and-stage workflow. If you enable auto-update, inspect the result just as carefully before committing. During git am, the Git project’s git-am documentation also documents --no-rerere-autoupdate as a way to prevent rerere from updating the index automatically.

How Git decides a conflict matches

Rerere does not compare whole files or infer programmer intent. It normalizes conflict content and looks for a matching conflict ID. The Git project’s rerere logic manual explains that normalization strips labels from conflict markers, removes common-ancestor content for diff3 and zdiff3 styles, and sorts conflict hunks. As a result, differences such as branch labels, conflict style, or merge order do not necessarily prevent a match.

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

For a regular conflict, the logic manual describes the ID as a SHA-1 hash of normalized hunks separated by NUL characters, with conflict markers stripped. When a saved resolution is reused, Git performs a three-way merge involving the earlier conflicted auto-merge, the earlier hand resolution, and the current conflicted auto-merge. If that merge is clean, Git writes the result into the working tree. A clean result only means the merge completed without a textual conflict; it does not prove the old decision is correct for the current code.

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

Inspect, correct, or remove rerere records

These commands help you see what rerere is handling and manage saved choices:

Command What it does
git rerere status Lists paths with conflicts whose resolution rerere will record.
git rerere remaining Lists paths with conflicts that were not autoresolved, including conflict types rerere cannot track, such as conflicting submodules.
git rerere diff Shows changes to the current resolution as you make it.
git rerere forget <pathspec> Resets the recorded resolution for matching paths in the current conflicts.
git rerere clear Resets rerere metadata when you abandon a merge resolution.
git rerere gc Prunes old conflict records.

If an earlier choice is no longer appropriate, use git rerere forget <pathspec> for the affected path rather than letting Git reuse that choice again. When aborting a resolution, git rerere clear resets its metadata; Git’s am and rebase skip or abort flows invoke this cleanup automatically.

Limits and record retention

Rerere relies on conflict-marker syntax to identify conflicts. Source lines that look like conflict markers can confuse detection; the rerere logic manual points to the conflict-marker-size gitattributes setting as a workaround. Unmatched conflict markers can also prevent rerere from handling a conflict. These are edge cases, not the normal repeated-merge workflow.

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

Some conflict types cannot be tracked for autoresolution. Conflicting submodules, for example, can appear in git rerere remaining rather than being resolved automatically.

Saved records are not permanent. According to the current git-rerere manual, git rerere gc uses defaults of 15 days for unresolved records and 60 days for resolved records. These are age thresholds applied when garbage collection runs, not a schedule or guarantee that cleanup happens at those intervals. The Git configuration documentation identifies gc.rerereUnresolved and gc.rerereResolved as the settings that control those periods.

Choose a scope and review policy

  • For recurring conflicts: Enable rerere if the same normalized conflict tends to return during test merges, rebases, or integration. It offers less benefit for isolated, unrelated conflicts.
  • For one repository: Use repository-local git config rerere.enabled true if you do not want to enable it everywhere. Use --global for a user-wide preference.
  • For review-first staging: Leave rerere.autoUpdate at its documented default of false, review the working-tree diff, test, and stage manually.
  • For a stale saved choice: Forget the record for the current conflict path instead of reusing a resolution that no longer fits.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.