Synopsis
git config --global rerere.enabled true
git rerere status
git rerere diff
git rerere clear
Description
The git rerere command (Reuse Recorded Resolution) records how you resolve a conflict the first time and replays the same resolution automatically the next time the same conflict appears. It is invaluable when long-lived feature branches are repeatedly merged or rebased onto a moving base — without rerere, you re-resolve the same conflicts every time.
Rerere is opt-in. Enable it globally with git config --global rerere.enabled true. Once enabled, every conflict resolution gets cached, and Git automatically applies the cached resolution on future encounters of the same conflict pre-image.
In day-to-day use, git rerere integrates closely with shell aliases, editor plugins, and continuous integration. Power users often add aliases that combine flags they always pass, or wrap the command in scripts that enforce team conventions. Output formatting can be customized via Git config — pretty formats, color schemes, and pager behavior are all tunable. When something goes wrong, the first diagnostic step is usually to re-run the command with GIT_TRACE=1 in the environment, which reveals the underlying plumbing calls. For unusual situations, the --help output (git rerere --help) opens the full manual page with details on every option, including those rarely used in casual workflows but essential for debugging or scripting at scale.
Understanding how git rerere interacts with the rest of Git's data model — the object database, the index, refs, and the working tree — pays dividends. Each command operates on some subset of these pieces, and knowing which it touches helps predict outcomes and recover from mistakes. Reading the official Git documentation alongside hands-on practice in a throwaway repository is the fastest way to internalize the nuances. Most production issues with Git stem from one of three causes: surprising default behavior, partial network operations, or rewriting history that was already shared. A working mental model of git rerere's side effects helps avoid all three.
Common Options
| Subcommand / Config | Description |
|---|---|
rerere.enabled | Turn on automatic recording. |
rerere.autoUpdate | Automatically stage resolved files. |
status | Show files with recorded resolutions. |
diff | Display the recorded resolution. |
remaining | Show conflicts not yet resolved. |
clear | Drop all recorded resolutions. |
forget <path> | Forget the resolution for a single path. |
Examples
git config --global rerere.enabled true
git config --global rerere.autoUpdate true
# Enable for all repos
# After resolving a conflict during merge or rebase, rerere remembers.
# Next time the same conflict appears, the resolution is auto-applied.
git rerere status
# Show files where a recorded resolution kicked in
git rerere clear
# Wipe the recorded set if it gets stale
Common Mistakes
Rerere only helps with identical conflicts. Slight context changes prevent reuse. If a recorded resolution turns out to be wrong, use git rerere forget <path> to clear it before re-resolving. Rerere data lives in .git/rr-cache/ and is local — it isn't shared with collaborators.
Related Commands
git merge, git rebase, git mergetool, git config