Arezgitfield notes / engineering
Git workflowsUPDATED OCT 28, 2026

Review Reused Conflict Resolutions with Git Rerere

Use Git rerere to reuse recorded text resolutions while preserving manual staging, checking changed intent, and correcting an unsuitable remembered result.

Arezgit Editorial6 min read
AREZGIT / FIELD NOTEGIT WORKFLOWS
The same text conflict can return every time a long lived branch is tested against its integration base. Repeating the mechanical edit wastes attention, but automatically accepting the previ
READ / VERIFY / APPLYTECHNICALLY REVIEWED

The same text conflict can return every time a long-lived branch is tested against its integration base. Repeating the mechanical edit wastes attention, but automatically accepting the previous result can preserve an obsolete business decision. Use recorded resolutions to prepare the text, then review the result against the current change.

Git rerere records conflict resolutions and can reuse them when a matching conflict returns. This guide focuses on reviewing that reuse and repairing an unsuitable result. It assumes ordinary text conflicts in a disposable practice repository before adoption in active work.

Choose a conflict whose repetition is mechanical

The exercise below makes two branches change the same timeout setting. A textual resolution is easy to record; deciding which timeout the application needs is the part that must be reviewed again when requirements change.

The rerere manual describes recording a conflicted automerge result and its manually resolved counterpart. That mechanism concerns text. It cannot establish that an old timeout value, permission choice, or deployment setting remains suitable after adjacent code changes.

Prefer a trial conflict with a clear testable outcome. A dependency lockfile generated by a package manager may require regeneration rather than manual text reuse. A submodule conflict concerns repository identities and needs its own analysis. Select the workflow based on the artifact's meaning instead of trying to make every conflict fit the same tool.

Keep the first adoption small enough that the reviewer can inspect the whole result. If the only success criterion is that conflict markers disappeared, the review has not yet checked the behavior the merge is supposed to preserve.

Keep the index under deliberate review

In the practice repository, enable recording locally and keep automatic index updates disabled. These commands work in Bash and PowerShell with Git installed:

git config --local rerere.enabled true
git config --local rerere.autoupdate false

The Git configuration reference distinguishes reusing a resolution in the working tree from allowing rerere to update the index. Keeping staging manual creates a useful inspection point between text reuse and the next committed snapshot.

After a merge or rebase reaches the conflict, inspect the current situation:

git status --short
git rerere status
git rerere remaining
git rerere diff

The commands answer different questions about tracked state, recorded paths, unresolved work, and resolution differences. Do not treat an empty list from one command as proof that the whole operation is ready to continue. Review the relevant working-tree diff and test the intended behavior before staging the resolved files.

If a tool or alias uses different local configuration, account for it explicitly. A teammate's setup should not silently determine whether your own index was updated automatically.

Reproduce a resolution without staging it automatically

Use this repeatable exercise in a fresh repository with a clean working tree and a configured synthetic author. It uses Bash file creation; the Git commands themselves also work in PowerShell. Run each command separately and inspect its exit status. The merge is expected to stop with a conflict.

git init -b main
printf 'timeout=10\n' > settings.txt
git add settings.txt
git commit -m "Set initial timeout"
git switch -c topic
printf 'timeout=20\n' > settings.txt
git commit -am "Change topic timeout"
git switch main
printf 'timeout=30\n' > settings.txt
git commit -am "Change main timeout"
git config --local rerere.enabled true
git config --local rerere.autoupdate false
git merge topic

For this fixture only, choose timeout=25 as the agreed resolution. Record it explicitly, then abort the practice merge after recording. Aborting discards this uncommitted practice resolution; do not use this sequence around unrelated work.

printf 'timeout=25\n' > settings.txt
git rerere
git merge --abort
git merge topic
git status --short
git ls-files --unmerged -- settings.txt

The second merge can reuse timeout=25 in the working tree while status still reports UU and the index retains unmerged entries. That is the inspection boundary created by rerere.autoupdate=false. Reuse does not mean the merge has succeeded or that Git staged the result. Read the file, test the chosen behavior, and only then use git add -- settings.txt if continuing this practice merge.

Review the timeout against the current requirement

When the conflict returns and rerere reapplies a result, compare that text with both sides of the current operation. Ask which intention each side introduced and whether the remembered edit still represents the required combination. The previous resolution is evidence about an earlier decision, not approval of the present one.

For the synthetic configuration, suppose the earlier resolution chose a larger timeout because a dependency was slow. The new branch may remove that dependency or introduce a stricter end-to-end deadline. The same line-level conflict can now require a different answer even though the stored text still fits.

Use a targeted test that distinguishes the old behavior from the newly intended behavior. Also inspect nearby error handling and defaults. A test that merely confirms the configuration file parses would miss the decision that made the conflict consequential.

After staging, inspect the staged diff before continuing the merge or rebase. The conflict resolution guide explains how working-tree, index, and continuation states fit together. Recorded reuse belongs inside that review process.

Correct an unsuitable remembered resolution

Stop before committing when the reused result is wrong. Identify the exact path and the operation in progress, preserve any independent edits, and use the documented forget operation for the current conflict. In the synthetic repository, the targeted command is:

git rerere forget -- settings.txt

This resets the remembered resolution for the matching current conflict. It is not a general command for restoring arbitrary files or undoing a completed merge. Recreate the conflicted state only through a procedure appropriate to the current merge or rebase, after checking which edits that procedure would replace.

For the unmerged fixture above, forgetting the resolution leaves the current working file to inspect; it does not by itself replace it with conflict markers. While the index still contains the conflict stages, git checkout --conflict=merge -- settings.txt can recreate the conflicted working file. This overwrites that path's working contents, so preserve any edits first and verify the path with git ls-files --unmerged before using it. Edit the new resolution and run git rerere to record it, then inspect and stage deliberately.

If the operation should be abandoned altogether, use the operation's documented abort path after preserving work that must survive. Avoid deleting internal cache directories as an improvised repair; that makes the scope of discarded resolution history harder to review.

Test reuse with a changed expectation

Before adopting the workflow broadly, run two practice cases. In the first, recreate the same conflict and verify that the recorded edit is proposed while staging remains deliberate. In the second, change the expected behavior and verify that the reviewer rejects or corrects the now-unsuitable reuse.

Inspect a failed continuation as well. Missing resolutions and failed tests should leave a clear next action, not pressure to stage every file just to finish the operation. Preserve the branch's purpose and the current operation state in the review notes.

For rebased patch series, the range-diff guide adds another view of what changed during rewriting. The acceptance criterion remains behavioral: the final staged snapshot should satisfy today's intent, whether its text came from a fresh edit or a recorded resolution.

READER SIGNAL

Was this guide useful?

Your rating helps us prioritize clearer, more practical technical content.

AREZGIT / DESKTOP WORKSPACEFROM FIELD NOTE TO RELEASE

Review diffs, run checks, and prepare the release in Arezgit.

Keep Git review, security scanning, API checks, database inspection, and release preparation together in one local desktop application.

Explore Arezgit