Using Git Rerere to Reuse Conflict Resolutions
Learn how Git's rerere feature records and replays conflict resolutions automatically during repeated rebases and merges.
Using Git Rerere to Reuse Conflict Resolutions is a free DevOps Bootcamp lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What is Rerere?
Rerere stands for reuse recorded resolution. When enabled, Git remembers how you resolved a conflict and automatically reapplies the same resolution if it sees the identical conflict again.
Why Rerere Helps
During long-running rebases or repeated merges of the same branch, the same conflict can appear over and over. Rerere saves you from solving it by hand each time.
Enabling Rerere
Turn it on globally with a single config setting.
git config --global rerere.enabled trueHow It Records
When a conflict happens, Git stores the pre-resolution state. After you fix and stage the file, Git records your resolution.
git merge feature
# CONFLICT in app.js
# Recorded preimage for app.jsResolving Once
Resolve the conflict normally, then stage the file. Rerere quietly stores how you did it.
# edit app.js to fix conflict
git add app.js
# Recorded resolution for app.jsAutomatic Replay
Next time the exact same conflict appears, Git resolves it for you and tells you it did.
git rebase main
# Resolved app.js using previous resolutionChecking Rerere Status
Use git rerere status to see which files have recorded conflict states pending.
git rerere statusViewing the Diff
git rerere diff shows what the recorded resolution will apply, so you can confirm it before continuing.
git rerere diffForgetting a Resolution
If you recorded a wrong resolution, clear it for a file so Git asks you again next time.
git rerere forget app.jsRerere and Rebasing
Rerere shines during interactive rebases where you may replay the same commits repeatedly. It removes most of the repetitive conflict work.
git rebase -i HEAD~10Limitations
Rerere only matches identical conflicts. If the surrounding code changes, the recorded resolution will not apply, and you resolve manually.
Quick Check
Test your understanding of rerere.
Recap
You learned to use rerere:
- Enable with
rerere.enabled true - Resolve a conflict once, Git records it
- Identical conflicts are auto-resolved later
git rerere forgetclears a bad resolution
It is invaluable for long rebases.
Frequently asked questions
Is the “Using Git Rerere to Reuse Conflict Resolutions” lesson free?
Yes — the full text of “Using Git Rerere to Reuse Conflict Resolutions” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.
What will I learn in “Using Git Rerere to Reuse Conflict Resolutions”?
Learn how Git's rerere feature records and replays conflict resolutions automatically during repeated rebases and merges. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start DevOps Bootcamp?
No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Using Git Rerere to Reuse Conflict Resolutions” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this DevOps Bootcamp lesson?
Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Manual Merge Conflict Resolution
- Interactive Rebasing for History
- Cherry-picking Commits
- Using Git Rerere to Reuse Conflict Resolutions