What is git rerere?
Answer
git rerere (reuse recorded resolution) is a Git feature that records how you resolve merge conflicts and automatically re-applies the same resolution next time the same conflict occurs. This is extremely useful in workflows with frequent rebases or long-lived branches. Enable: git config --global rerere.enabled true. How it works: when you resolve a conflict and commit, Git records the conflicted state and your resolution. Next time Git encounters the same conflict (same "left side" and "right side"), it automatically applies the previous resolution. Rerere storage: .git/rr-cache/. Commands: git rerere status — show files rerere will resolve; git rerere diff — show recorded resolutions that will be applied; git rerere forget file.txt — forget a recorded resolution. Use case: you maintain a long-running feature branch that you regularly rebase onto main. The same files often conflict repeatedly. With rerere, Git remembers your resolutions and applies them automatically, turning a manual process into an automated one. Another use: when a merge conflict resolution was wrong — forget it and redo. Rerere data is local (not pushed to remote).