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. This is lesson 4 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.
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.
Learn DevOps Bootcamp with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 142
- Lessons
- 568
Frequently Asked Questions
Is the “Using Git Rerere to Reuse Conflict Resolutions” lesson free?
Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Using Git Rerere to Reuse Conflict Resolutions”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.
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, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.
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