git commit无法打开编辑器

Luc*_*elo 5 git github git-bash

我有一个问题,每当我运行git commit时,都会显示出来:

error: cannot spawn subl: No such file or directory
error: unable to start editor 'subl'
Please supply the message using either -m or -F option.
Run Code Online (Sandbox Code Playgroud)

subl是崇高的别名。我在Win10上运行git Bash。
如果我只是运行' subl',它将打开编辑器而不会出现问题,但是使用git commit不会。这是我的git配置文件:

[core]
    editor = subl -w -n
Run Code Online (Sandbox Code Playgroud)

pla*_*r87 7

执行git config --global core.editor "\"C:\Program Files\Sublime Text 3\sublime_text.exe\" %*"以将 Sublime 配置为 Windows 中的编辑器。

编辑:以上假设您已安装 Sublime 3。如果您安装了 Sublime 2,请将完整路径更改为 sublime_text.exe 的正确有效路径。