在 Windows 7 中使用 Git,我尝试通过不同的方式设置文本编辑器:
$ git config --global core.editor "C:\Program Files\Notepad++\notepad++.exe"
$ git config --global core.editor \"C:\Program Files\Notepad++\notepad++.exe\"
$ git config --global core.editor 'C:\Program Files\Notepad++\notepad++.exe'
但是当我查看配置文件(通过命令 git config --list
)时,得到的结果是相同的:
core.editor=C:\Program Files\Notepad++\notepad++.exe
因此,我无法提交,会出现错误:
$ git commit C:\Program Files\Notepad++\notepad++.exe: C:Program: command not found error: There was a problem with the editor 'C:\Program Files\Notepad++\notepad++ .exe'. Please supply the message using either -m or -F option.
我尝试手动编辑.gitconfig文件(添加引号),但这并没有帮助我。
为什么引号被忽略了,我该如何解决?