Merge conflicts are a normal part of working with Git, especially when collaborating with teams or maintaining long-running branches. But resolving the same conflicts repeatedly can quickly become frustrating and time-consuming.
Git provides a powerful but lesser-known feature called rerere (reuse recorded resolution) that helps automate repeated conflict resolution.
In this article, we’ll explore what Git rerere is, how it works internally, where it stores data, and why developers should enable it.
Git rerere stands for reuse recorded resolution.
It records how you resolve merge conflicts and automatically applies the same resolution if the same conflict occurs again.
Instead of manually fixing identical conflicts multiple times, Git remembers your previous solution and reuses it.
This is especially useful when:
In real-world development, conflicts frequently reappear.
For example:
Without rerere → resolve again manually. With rerere → Git resolves automatically.
Git rerere follows a simple process:
A conflict occurs during merge or rebase.
You resolve the conflict manually.
Git records both:
If the same conflict happens again, Git automatically applies your previous fix.
This makes repeated merges significantly faster.
Git stores conflict resolution records locally inside your repository:
.git/rr-cache/
This directory contains:
Git compares future conflicts with this stored data and applies matching resolutions automatically.
Important notes:
You can enable rerere globally with one command:
git config --global rerere.enabled true
Once enabled:
Most experienced developers enable it once and keep it on.
Imagine two branches modify the same line of code.
This is particularly helpful during repeated rebases.
git rerere status
Shows files where Git recorded or reused resolutions.
git rerere diff
Displays the difference between the conflict and its resolution.
git rerere clear
Removes all recorded resolutions.
Useful if:
git config --global rerere.enabled false
Stops Git from recording future resolutions.
Git rerere is most valuable in:
For small personal projects, you may not notice much benefit. For larger projects, it can significantly improve productivity.
Git rerere only works when:
If the conflict is very different, Git may not auto-resolve it.
Large teams and companies often enable rerere because:
It quietly improves productivity without changing how developers work.
Git rerere is a simple yet powerful feature that many developers overlook. By remembering conflict resolutions and automatically reusing them, it removes repetitive work and makes merges and rebases smoother.
If your workflow involves frequent merges or rebasing, enabling rerere is an easy way to save time and reduce frustration.
Sometimes the best developer tools are the ones working silently in the background — and Git rerere is one of them.