我知道这个问题已被多次询问和回答。但我尝试了至少十种不同的方式来做这个答案,并没有一个对我有用。当我这样做时,我总是把nano
作为编辑
git commit
(如果我可以剪切并粘贴到nano
中,这不会是一个大问题,但它无法完成)
举个例子,这里是我的.gitconfig
文件中的行,但请记住我尝试了很多变化:
[core]
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
这应该工作:
[core]
editor = \"C:/Program Files (x86)/notepad++/notepad++.exe\" -multiInst -notabbar -nosession -noPlugin
PS:您可以安装GitExtensions,为您设置它...
它不优雅,但这对我有用(用单引号括起双引号):
git config --global core.editor '"C:/Program Files/Notepad++/notepad++.exe"'