Interview Prep/Git & GitHub/Merge and Rebase Problems

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.

All Git & GitHub questions Roadmap: Git & GitHub

More on Merge and Rebase Problems