为什么我不能将notepad ++设置为Windows 10中的git commit editor?

问题描述 投票:0回答:2

我知道这个问题已被多次询问和回答。但我尝试了至少十种不同的方式来做这个答案,并没有一个对我有用。当我这样做时,我总是把nano作为编辑

git commit

(如果我可以剪切并粘贴到nano中,这不会是一个大问题,但它无法完成)

举个例子,这里是我的.gitconfig文件中的行,但请记住我尝试了很多变化:

[core]
    editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
git commit git-commit
2个回答
1
投票

这应该工作:

[core] editor = \"C:/Program Files (x86)/notepad++/notepad++.exe\" -multiInst -notabbar -nosession -noPlugin

PS:您可以安装GitExtensions,为您设置它...


1
投票

它不优雅,但这对我有用(用单引号括起双引号):

git config --global core.editor '"C:/Program Files/Notepad++/notepad++.exe"'
© www.soinside.com 2019 - 2024. All rights reserved.