Progress:
TIER 2 · MODULE 23· Intermediate

git rerere

Re-Recorded Resolution. Conflict autopilot — once you opt in.

🎯 What & why

git rerere (REused REcorded REsolution) records how you resolve a conflict and replays that resolution the next time the same conflict appears. It is a quiet productivity multiplier on long-lived topic branches and repeated rebases.

🧠 Mental model

A key-value cache: key is the pre-image conflict hunk, value is your resolution. On re-encounter, git stages the cached resolution automatically; you only re-verify.

🛠️ Synopsis

git rerere [clear | forget <pathspec> | diff |
            remaining | status | gc]

🎚️ Switches & options

FlagWhat it does
rerere.enabled=trueConfig switch; rerere does nothing until you set this.
rerere.autoUpdate=trueAuto-stage replayed resolutions instead of just applying them to the worktree.
--rerere-autoupdatePer-command override for merge/rebase/cherry-pick.

📦 Subcommands

clear — Wipe all recorded resolutions for the current merge.
git rerere clear
forget <path> — Drop the recorded resolution for a specific path; re-record on next conflict.
git rerere forget src/api.py
diff — Show what rerere would apply for the current conflicts.
git rerere diff
remaining — List paths that still have unresolved conflicts.
git rerere remaining
status — Show paths where rerere has recorded data for the current conflict.
git rerere status
gc — Prune old, unused recorded resolutions from .git/rr-cache.
git rerere gc

💡 Use cases

🧪 Examples

Turn it on globally
git config --global rerere.enabled true
Forget a bad recorded resolution
git rerere forget path/to/file.txt
See what rerere is about to do
git rerere diff
Garbage-collect stale entries
git rerere gc

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.