`error: could not read '.git/rebase-merge/head-name': No such file or directory`
AdvancedTroubleshootingMerge and Rebase Problems
Answer
Likely causes → Rebase state is inconsistent: the rebase directory was partly deleted, a second Git process interfered, or a crash corrupted it.
Diagnose →
ls -la .git/rebase-merge .git/rebase-apply 2>/dev/null
git status
git reflog -15
Fix → Record the pre-rebase tip from the reflog (rebase (start) entry, minus one). Remove the broken state (rm -rf .git/rebase-merge), then git switch <branch> and git reset --hard <pre-rebase-sha>. Redo the rebase carefully.
Prevent → Do not run IDE Git actions and terminal Git commands in parallel during a rebase.
More on Merge and Rebase Problems
Production failed to start, and the file contains `<<<<<<< HEAD` lines that were committed.Beginner`error: you need to resolve your current index first`Beginner`fatal: You have not concluded your merge (MERGE_HEAD exists).`BeginnerRebase stops: `error: could not apply 1a2b3c4... Add retry` and later `No changes - did you forget to use 'git add'?`Intermediate`fatal: It seems that there is already a rebase-merge directory, and I wonder if you are in the middle of another rebase.`Intermediate`CONFLICT (modify/delete): config/old.yml deleted in HEAD and modified in feature.`Intermediate