Workflows

Rerere for Recurring Conflicts

Use rerere to record and reuse conflict resolutions when the same merge or rebase conflicts appear again and again.

Who This Is For
  • Teams turning commands into repeatable routines
  • Readers who need sequencing, branch, and sync discipline
Prerequisites
  • Basic understanding of fetch, pull, push, and branches
  • A sense of how and why branches diverge
Common Risks
  • Copying a workflow without checking branch state
  • Choosing the wrong integration path on shared branches

What this workflow solves

Rerere Conflict Reuse FlowRerere (reuse recorded resolution) records conflict solutions and auto-applies them next time the same conflict occurs. Especially useful for long-lived branches and frequent rebases.
Conflict Scenario
First encounter conflictManually resolvererere records solution
Conflict Resolved
rerere.enabled = true → auto-recordNext same conflict → auto-applyConfirm with git rerere status
rerere is disabled by default. Enable with rerere.enabled = true in repo. Records stored in .git/rr-cache/.

On long-lived branches and repeated rebases, the exhausting part is often not conflict itself but solving the same conflict over and over again.

rerere helps Git remember how you resolved a conflict before, so similar conflicts can be reused later.

When rerere is worth enabling

  • long-lived branches sync with main regularly
  • the same files conflict repeatedly
  • the team backports or replays similar fixes across multiple branches

Minimal setup

git config --global rerere.enabled true
git config --global rerere.autoupdate true

The first conflict still needs normal manual resolution. The win appears when similar conflicts show up again.

Common mistakes

  • assuming rerere replaces understanding the conflict
  • accepting reused results without checking them
  • expecting perfect reuse when the surrounding context has changed heavily