运行git commit时与编辑器有关的错误?
I get the following error when running Git commit:
这是什么意思?我该如何解决它?
c:/Program/ Files/ /(x86/)/Notepad++/notepad++.exe: -c: line 0: syntax
error near unexpected token `('
c:/Program/ Files/ /(x86/)/Notepad++/notepad++.exe: -c: line 0: `c:/Pr
ogram/ Files/ /(x86/)/Notepad++/notepad++.exe \$@\'
error: There was a problem with the editor 'c:/Program/ Files/ /(x86/)
/Notepad++/notepad++.exe'.
Please supply the message using either -m or -F option.
我刚刚遇到了这个问题,并发现你的问题试图找出它,我也认为它需要用空格和圆括号IN .gitconfig的转义字符,但显然不是。
I was just running into this, and found your question trying to figure it out. I too assumed it needed escape characters for the spaces and parentheses IN .gitconfig, but apparently not. This statement worked for me:
editor = C:/Program Files (x86)/Notepad++/notepad++.exe
这是在我的.gitcon中创建的fig文件的命令如下:
Which was created in my .gitconfig file by the below command:
git config --global core.editor /c/Program\ Files\ \(x86\)/Notepad\+\+/notepad\+\+.exe
我必须删除无效行,然后用上面的命令设置才行。
I had to remove the invalid line, before setting it with the above command would work.
不幸的是,git commit仍然不起作用。在它周围添加引号和单引号终于奏效,在运行的Notepad ++窗口中启动COMMIT_EDITMSG:
Unfortunately, git commit still didn't work. Adding both Quotation marks and single quotes around it finally worked, launching the COMMIT_EDITMSG in my running Notepad++ window:
editor = "'C:/Program Files (x86)/Notepad++/notepad++.exe'"
平台是Windows 8.1 Pro x64 ,MINGW64 / Bash shell,从 https://git-scm.com Windows客户端安装。
Platform is Windows 8.1 Pro x64, the MINGW64/Bash shell, installed from the https://git-scm.com Windows client.