Git cannot launch the configured sequence editor when starting an interactive rebase. This typically occurs when the editor is misconfigured, missing, or incompatible with the terminal environment.
This error appears when Git attempts to open a text editor for an interactive rebase (`git rebase -i`) but fails to launch the configured sequence editor. During an interactive rebase, Git needs to open an editor so you can modify the rebase instruction sheet (the git-rebase-todo file). If the editor command is invalid, points to a non-existent program, or cannot be executed in the current environment, Git will abort with this error. Git uses a specific hierarchy to determine which editor to use for interactive rebase operations: first it checks the GIT_SEQUENCE_EDITOR environment variable, then the sequence.editor config setting, then falls back to GIT_EDITOR or core.editor. If any of these point to an invalid editor, the rebase operation will fail immediately. This is different from commit message editing, which uses core.editor. While it's common for both to use the same editor, having them configured differently can lead to confusion and errors when the sequence editor is misconfigured but regular commits work fine.
First, identify what sequence editor Git is configured to use:
# Check all editor-related configuration
git config --list | grep editor
# Specifically check sequence editor
git config --get sequence.editor
# Check environment variables
echo $GIT_SEQUENCE_EDITOR
echo $GIT_EDITORLook for any reference to a program name that doesn't exist on your system, like interactive-rebase-tool, rebase-editor, or an incorrect IDE path.
If you found an invalid sequence.editor setting, remove it:
# Remove from global config
git config --global --unset sequence.editor
# Or remove from local repository config
git config --unset sequence.editorThis will cause Git to fall back to your core.editor or GIT_EDITOR setting.
Configure a reliable text editor that works in your terminal:
# Use vim (available on most systems)
git config --global core.editor vim
# Use nano (beginner-friendly)
git config --global core.editor nano
# Use VS Code (requires --wait flag)
git config --global core.editor "code --wait"
# Use Sublime Text
git config --global core.editor "subl -n -w"Important: GUI editors like VS Code and Sublime Text require the --wait or -w flag so Git waits for you to close the file before continuing.
Verify the editor works before attempting another rebase:
# Test with a commit (uses core.editor)
git commit --allow-empty -m "Test commit"
# Test with interactive rebase on a safe commit
git rebase -i HEAD~1The editor should open successfully. If it does, type :q (vim) or Ctrl+X (nano) to exit without making changes.
If you were in the middle of a rebase when the error occurred:
# Abort the rebase and return to original state
git rebase --abort
# Or quit the rebase and leave HEAD detached
git rebase --quitUse --abort to completely undo the rebase. Use --quit if you want to preserve the current state.
One-time editor override: You can specify an alternative editor for a single rebase command without changing your config:
git -c sequence.editor=vim rebase -i HEAD~3Environment variable for temporary change:
GIT_SEQUENCE_EDITOR=nano git rebase -i origin/mainNon-interactive rebases: For automated workflows, you can use a no-op editor with autosquash:
GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash origin/mainThis sets the editor to the shell's true command, which exits immediately with success.
Windows path issues: On Windows, if your editor path contains spaces or backslashes, ensure it's properly escaped:
git config --global core.editor "'C:/Program Files/editor/editor.exe' --wait"Difference between core.editor and sequence.editor: While both can be set to different editors, this is generally not recommended. The sequence editor is specifically for editing the rebase instruction sheet, while core.editor is for commit messages. Having them differ can create confusion.
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