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

Citations & Further Reading

  1. Git rerere [Official]
  2. Git Tools Rerere [Book]

What you will learn

  • Understand the core purpose of Rerere for Recurring Conflicts
  • Master the basic usage and common options of Rerere for Recurring Conflicts
  • Use rerere to record and reuse conflict resolutions when the same merge or rebase conflicts appear again and again.
  • Understand key concepts: What this workflow solves
  • Know when to use this feature and when to avoid it

Start with a problem

Your team is collaborating on a project, branches are growing, merges are becoming more frequent — but there's no stable collaboration rhythm. Everyone syncs code their own way, and conflicts are piling up.

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

Try it yourself

  1. Practice the rerere-for-recurring-conflicts command in a test repository and observe state changes before and after
  2. Experiment with different options and compare the output differences
  3. Simulate a real scenario where you would need to use this, and walk through the full process

Further reading

Keep going on the same topic: