agentleFS
narenaryannarenaryan/agent-skills/skills/git/git-rerere/SKILL.md

git-rerere

Skill0 starsChanged 39 days agoMITView on GitHub

Use when the same merge conflicts keep recurring across rebases or long-running integration branches — enables automatic replay of previously-recorded resolutions

  • Deletes or force-pushes

The file

Files
SKILL.md

Git Rerere (Reuse Recorded Resolution)

Rerere fingerprints conflict hunks + resolutions. On any later merge/rebase/cherry-pick producing the same conflict, Git auto-applies the stored fix.

Enable

git config --global rerere.enabled true
git config --global rerere.autoupdate true   # also stage auto-resolved files

Storage: .git/rr-cache/<hash>/{preimage,postimage}. Local, not pushed.

Commands

git rerere status         # files with recorded preimages
git rerere diff           # current vs recorded resolution
git rerere remaining      # unresolved files
git rerere forget <file>  # discard a recorded resolution
git rerere gc             # prune old entries

Flow

  1. First conflict: Recorded preimage for 'file'.
  2. Resolve + commit: Recorded resolution for 'file'.
  3. Next time the same conflict appears: Resolved 'file' using previous resolution. — with autoupdate, already staged.

Canonical Uses

  • Long-running topic branch rebased onto main repeatedly.
  • Nightly integration branches that merge many topics, reset, re-merge.
  • Test-merge-and-reset to pre-record resolutions:
    git merge feature && git reset --hard HEAD~
    # resolution is recorded; next merge applies it automatically

Sharing

rr-cache isn't pushed. Copy between checkouts:

rsync -a .git/rr-cache/ other-repo/.git/rr-cache/

Pitfalls

  • Matches exact conflict content — whitespace/ordering drift breaks the match. Check git rerere diff before trusting auto-resolution.
  • With autoupdate=true, a bad past resolution silently re-applies. Spot-check.
  • Auto-resolved files show no conflict markers; use git rerere forget <file> to re-surface for manual redo.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.