Skip to content

Git Rerere

Spicy — senior dev territoryGit & Version Control

ELI5 - The Vibe Check

Rerere stands for reuse recorded resolution, and it's git remembering how you resolved a merge conflict so it never has to bother you with the exact same conflict again. Rebasing the same long-lived branch for the tenth time and manually fixing the same three-line conflict every single time? Turn on rerere once, and git just applies your previous fix automatically from then on.

Real Talk

git rerere (reuse recorded resolution) records the state of a conflict and its resolution the first time a developer resolves it manually, then automatically reapplies that same resolution if an identical conflict recurs, which commonly happens during repeated rebases of a long-lived branch against a moving target. It is disabled by default and enabled per repository with git config rerere.enabled true.

Show Me The Code

$ git config rerere.enabled true
$ git rebase main
# resolve the conflict once by hand, then:
$ git add . && git rebase --continue
# next rebase, the same conflict auto-resolves

When You'll Hear This

"Turn on rerere before you rebase this branch for the fifth time this week." / "Rerere just auto-fixed the merge conflict we've hit every rebase."

Made with passive-aggressive love by manoga.digital. Powered by Claude.