Interview Prep/Git & GitHub/Branching and Merging Workflows

You keep resolving the same conflicts again and again while rebasing a long-lived branch. How do you stop?

IntermediateScenarioBranching and Merging Workflows
Answer

Situation read → Each replayed commit hits the same hunks, and you redo the resolution every time.

What I'd do →

  1. Enable rerere (reuse recorded resolution): git config --global rerere.enabled true.
  2. Resolve once; Git records the preimage and your resolution under .git/rr-cache.
  3. On later rebases or merges the same conflict is auto-resolved. Review with git diff and stage.
  4. If a recorded resolution is wrong: git rerere forget <path>.

Why → Git fingerprints the conflict text and replays your earlier answer.

Interview tip → rerere only records resolutions, it does not auto-stage them, so you still review.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching and Merging Workflows