DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk3 min

Git rerere Can Reuse Merge Conflict Fixes—Here’s How to Use It Safely

Git rerere can reuse a previous manual conflict fix. Enable it, inspect the working-tree result, and stage it only after confirming it is correct.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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

How 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.

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.

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

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.

  1. Check which paths have resolutions rerere will record with git rerere status.

  2. See which conflicts remain unresolved with git rerere remaining.

  3. Review resolution changes with git rerere diff, then inspect the working-tree change using git diff or git diff -c.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. 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.

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 clear resets rerere metadata when abandoning a merge resolution. Git notes that git am and git rebase skip or abort flows invoke it automatically.
  • git rerere gc prunes old records. The documented defaults retain unresolved records for 15 days and resolved records for 60 days; configure those periods with gc.rerereUnresolved and gc.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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

  • 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-size gitattributes 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.

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

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
PC Slower Than It Used to Be?Free scan - under a minute

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.