Git hangs with `hint: Waiting for your editor to close the file...` or fails with `error: There was a problem with the editor 'vi'`.
BeginnerTroubleshootingMerge and Rebase Problems
Answer
Likely causes → Git opened an editor (for a commit message, rebase todo or merge message) that is running in another window, not in the terminal, or no editor is installed. GUI editors need a "wait" flag.
Diagnose → git config --get core.editor, echo $EDITOR $GIT_EDITOR.
Fix → Save and close the editor. To set one: git config --global core.editor "code --wait" or "nano". In Vim, :wq saves and :cq aborts. For scripts, git commit -m "msg" or GIT_EDITOR=true git rebase --continue.
Prevent → Set the editor once globally.
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