Git rerere (reuse recorded resolution) failed to automatically apply a previously recorded conflict resolution. This happens when the cached resolution no longer matches the current conflict context.
Git rerere is a feature that records how you resolve merge conflicts and automatically reuses those resolutions when the same conflict appears again. The 'resolution failed' error occurs when rerere finds a matching conflict fingerprint in its cache (.git/rr-cache), but the three-way merge between the earlier conflict, the recorded resolution, and the current conflict cannot be applied cleanly. This typically happens because the code context has changed significantly since the original resolution was recorded, or the conflict structure has evolved in ways that make the cached resolution incompatible. Git tries to help by replaying your previous fix, but when the replay fails, it falls back to showing you the original conflict markers. Unlike a simple merge conflict, this error indicates that Git attempted to help using rerere but encountered an inconsistency between what was recorded and what currently exists in your working tree.
Use git rerere to see the status of recorded resolutions:
git rerere statusTo see which conflicts still need manual resolution:
git rerere remainingThis shows files that rerere couldn't resolve, including submodules and files with tracking issues.
Open the conflicted file and resolve it manually as you would any merge conflict:
1. Look for conflict markers: <<<<<<<, =======, >>>>>>>
2. Edit the file to resolve the conflict
3. Remove all conflict markers
4. Save the file
After resolving, stage the file:
git add <file>Git will record this new resolution for future use.
If rerere keeps applying an incorrect resolution, remove it from the cache:
git rerere forget <file>Note: You must apply the bad resolution first (by doing the merge), THEN forget it, THEN reset and redo the merge:
# After merge applies bad resolution
git rerere forget <file>
git reset --hard origin/<branch>
# Now redo the merge and resolve correctlyTo clear all rerere cache completely:
rm -rf .git/rr-cacheAfter resolving conflicts and staging files, continue your operation:
For rebase:
git rebase --continueFor merge:
git commitFor cherry-pick:
git cherry-pick --continueGit will now record the new resolution in rerere cache for future conflicts.
Always verify that rerere-assisted resolutions are correct:
# Review the changes
git diff
# Run your tests
npm test # or your test commandNote: git rerere leaves the index file alone and doesn't automatically stage files. You must always inspect results and run tests before committing.
Git rerere works by taking a fingerprint of conflicts and pairing them with fix fingerprints. The cache is stored in .git/rr-cache/, where each conflict gets a directory with 'preimage' (conflict state), 'postimage' (resolved state), and 'thisimage' files.
Conflict Marker Issues: If your code contains lines that look like conflict markers (e.g., documentation examples showing <<<<<<< or =======), rerere may fail. Use the conflict-marker-size setting in .gitattributes to work around this: 'file.txt conflict-marker-size=32'.
Garbage Collection: By default, unresolved conflicts older than 15 days and resolved conflicts older than 60 days are pruned via 'gc.rerereUnresolved' and 'gc.rerereResolved' config variables.
Sharing Rerere Cache: Teams can share rerere resolutions via a dedicated branch in the repository, or use 'rerere-train.sh' to learn resolutions from existing Git history. This helps team members automatically benefit from conflict resolutions made by others.
Long-lived Feature Branches: A key use case for rerere is maintaining long-lived topic branches. You can periodically attempt merges with the main branch, resolve conflicts, then back out (git reset --hard). When the final merge happens, rerere will apply all previously recorded resolutions automatically.
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server
fatal: unable to access: Proxy auto-configuration failed
How to fix 'Proxy auto-configuration failed' in Git
fatal: unable to access: Authentication failed (proxy requires basic auth)
How to fix 'Authentication failed (proxy requires basic auth)' in Git
fatal: unable to access: no_proxy configuration not working
How to fix 'no_proxy configuration not working' in Git
fatal: unable to read tree object in treeless clone
How to fix 'unable to read tree object in treeless clone' in Git