修复Mac下命令行Git无法在vi中commit的错误-- here was a problem with the editor 'vi'.
2013-03-06 11:46
615 查看
在命令行使用git commit进入VI编辑注释的时候,保存退出,给出以下提示,以前还好好的,忽然就不正常了‘
错误提示如下
出问题了就上搜索引擎,得到两篇文章,搞定
原文1:http://tooky.co.uk/2010/04/08/there-was-a-problem-with-the-editor-vi-git-on-mac-os-x.html
原文2:http://www.phpvim.net/app/vim/fix-issue-there-was-a-problem-with-editor-vim.html
错误提示如下
error: There was a problem with the editor 'vi'. Please supply the message using either -m or -F option.
出问题了就上搜索引擎,得到两篇文章,搞定
原文1:http://tooky.co.uk/2010/04/08/there-was-a-problem-with-the-editor-vi-git-on-mac-os-x.html
原文2:http://www.phpvim.net/app/vim/fix-issue-there-was-a-problem-with-editor-vim.html
I have had an annoying problem with git and vi. I like to use vim to edit my commit messages, but I’ve been hit with this annoying message every time I write the message and quit vim. error: There was a problem with the editor 'vi' After a little bit of digging I found that this message is shown by git when the editor exits with a non-zero exit code. You can use $? to see the exit code of last script or application. $ vim # then exit vim with :q immediately $ echo $? 1 I’m still not sure why vim is exiting with non-zero exit code, but it is definitely related to my .vimrc - moving it to .vimrc.bak seemed to fix the problem. I’m using the excellent pathogen plugin to manage my vimfiles, so I plan to go through that and my installed plugins to find the cause of the problem. There is a fix though, I’m not sure what’s causing this, but I found a post on the vim-mac mailing list which shows this: $ vim # and exit with :q $ echo $? 1 $ /usr/bin/vim # and exit with :q $ echo $? 0 $ which vim /usr/bin/vim Running vim with /usr/bin/vim seems to make it exit cleanly. So to fix the problem with git commit you just need to run this: $ git config --global core.editor /usr/bin/vim I’d still like to get to the root of the problem, but this gets me my git commit messages back!
相关文章推荐
- Fixing "There was a problem with the editor 'vi'" for Git on Mac OS X
- There was a problem with the editor 'vi' for Git on Mac OS X
- Git commit时候发生"error: There was a problem with the editor 'vi
- Mac git amend There was a problem with the editor 'vi'.
- windows 下git commit问题("error: There was a problem with the editor 'vi'")
- There was a problem with the editor ‘vi’
- 错误:A field or property with the name 'XXX' was not found on the selected data source 解决
- 打包出现这个错误Error:A problem was found with the configuration of task ':app:packageRelease'.
- msxml3.dll 错误 '80072efd' A connection with the server could not be established
- iOS开发出现的错误:loaded the "VCRoot" nib but the view outlet was not set.'
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'错误
- SharePoint 2010 Timer Job. 激活发生错误 The EXECUTE permission was denied on the object 'proc_putObject'
- swift编码出现Call can throw, but it is not marked with 'try' and the error is not handled错误的解决
- VS2008中Run-Time Check Failure #2 - Stack around the variable 'xxx' was corrupted 错误解决方法
- Mongodb无法启动:The default storage engine 'wiredTiger' is not available with this build of mongod.
- 编译错误“The run destination My Mac 64-bit is not valid for Running the scheme '***',解决办法
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'错误
- The document type declaration for root element type "config" must end with '>'.错误
- 错误:无法从 mirrors.163.com : The requested URL returned error: 404 Not Found 获取文件 'multilib.db'
- Invalid content was found starting with element 'taglib'错误 .