运行git commit时与编辑器有关的错误? [英] Error related to editor when running git commit?

查看:353
本文介绍了运行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.

这篇关于运行git commit时与编辑器有关的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆