`git rebase -i` fails with `error: invalid line 3: ...` or the todo list says `Nothing to do`.
IntermediateTroubleshootingMerge and Rebase Problems
Answer
Likely causes → You edited a line into an invalid command (typo, missing SHA, extra text), or the range contains no commits (you passed the wrong base, or HEAD equals the base).
Diagnose →
git log --oneline origin/main..HEAD # what the range contains
git rebase --edit-todo # reopen the todo list
Fix → Use valid commands (pick, reword, edit, squash, fixup, drop, exec). If the list is empty, pass the correct base, e.g. git rebase -i HEAD~5 or --root. Deleting every line aborts the rebase.
Prevent → Do not delete lines to drop commits; use drop.
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