Search code examples
gitrebase

Git "cannot spawn interactive-rebase-tool" and "unable to start editor 'interactive-rebase-tool'" when running "rebase -i"


When running "git rebase -i" in git bash, no text editor window pops up and the following messages are produced

hint: Waiting for your editor to close the file... error: cannot spawn 
interactive-rebase-tool: No such file or directory

error: unable to start editor 'interactive-rebase-tool'

I'm using the default editor, Vim. Committing works fine so far.

The Git version is 2.40.0.windows.1 and the Windows OS version is 10.0.19045.

I have tried searching for "interactive-rebase-tool", both for files on my hard drive and for information on the Internet, but to no avail. Rebooting and reinstalling Git didn't help, either.


Solution

  • You checked your configuration, and it turns out you have the following setting:

    $ git config --list | grep interactive-rebase-tool
    sequence.editor=interactive-rebase-tool
    

    This is the root cause of your issues: with this setting, git will try to launch a program named interactive-rebase-tool when you run git rebase -i -- and obviously you don't have one.


    Remove this setting.

    Check where this specific setting comes from:

    git config --show-scope sequence.editor
    

    The scope will probably say "local" or "global". To remove this setting :

    # local:
    git config --unset sequence.editor
    # global:
    git config --global --unset sequence.editor
    

    (you can have a look at git help config for extensive documentation on git config)