git rerere
Reuse recorded conflict resolutions
The 'git rerere' feature (reuse recorded resolution) remembers how you resolved a conflict and applies the same resolution automatically the next time the identical conflict appears — when you rebase again, re-merge a branch or redo a merge. Enable it with rerere.enabled; git then records conflicts and resolutions on its own. You still check the result and git add it.
Synopsis
git rerere [clear | forget <path> | diff | status | remaining | gc]Examples
Turn it on
git config --global rerere.enabled trueFrom now on conflicts and resolutions are remembered.
Conflicts with a record
git rerere statusFiles whose conflict is being recorded.
Forget a bad resolution
git rerere forget app.jsRecord it again next time.
Workflow Examples
git config rerere.enabled trueOnce
git merge main … resolve … git reset --hard HEAD~1Practice merges teach rerere
git merge mainThe real merge reuses your answers
Troubleshooting
A conflict was resolved wrongly
Cause: A bad resolution was recorded
git rerere forget <file>, resolve again, commit
Tips & Pitfalls
Best Practices
- ✓Turn it on globally if you rebase often.
- ✓Always review files rerere resolved before git add.
Common Mistakes
- ✗Recording a wrong resolution and having it reapplied silently — check files after merges and use rerere forget.
FAQ
Not by default: set rerere.autoUpdate true to stage resolved files automatically.