# git rerere: Usage, Options & Common CI Errors

> git rerere records and replays conflict resolutions so repeated merges resolve automatically. Reference for enabling it, status, forget, and CI rebase loops.

Source: https://latchkey.dev/learn/command-reference/git-rerere  
Updated: 2026-06-25

git rerere remembers how you resolved a conflict and reapplies it next time the same conflict appears.

On long-running branches that rebase repeatedly, rerere ("reuse recorded resolution") saves you from solving the same conflict over and over by replaying your earlier fix.

## What it does

When enabled, git rerere records the pre-image and your resolution of each conflict. The next time an identical conflict occurs, it auto-applies the stored resolution and stages the result.

## Common usage

```Terminal
git config --global rerere.enabled true
git rerere status               # conflicts being recorded
git rerere diff                 # what the recorded resolution changes
git rerere forget <path>        # discard a bad recorded resolution
```

## Options

| Subcommand | What it does |
| --- | --- |
| (config) rerere.enabled | Turn the feature on |
| status | Show conflicts currently tracked |
| diff | Show the recorded resolution diff |
| forget <path> | Drop a recorded resolution |
| gc / clear | Prune the recorded-resolution cache |

## Common errors in CI

rerere state lives under .git/rr-cache, which is local and not cloned - fresh CI checkouts have no recorded resolutions, so it helps persistent workspaces, not ephemeral runners. A wrong auto-resolution is silent; if rerere reapplies a bad fix, run git rerere forget <path> and re-resolve.

## Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

```.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached
```

> `git rev-parse --abbrev-ref HEAD` returns the literal string `HEAD` on a detached checkout rather than a branch name. On GitHub Actions read `github.ref_name` instead; the git command cannot know what it was checked out for.

## FAQ

### git rerere: Usage, Options & Common CI Errors?

On long-running branches that rebase repeatedly, rerere ("reuse recorded resolution") saves you from solving the same conflict over and over by replaying your earlier fix.

### What it does?

When enabled, git rerere records the pre-image and your resolution of each conflict. The next time an identical conflict occurs, it auto-applies the stored resolution and stages the result.

### Common errors in CI?

rerere state lives under .git/rr-cache, which is local and not cloned - fresh CI checkouts have no recorded resolutions, so it helps persistent workspaces, not ephemeral runners. A wrong auto-resolution is silent; if rerere reapplies a bad fix, run git rerere forget <path> and re-resolve.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
