Fixed "There was a problem with the editor 'vi'"

在用git提交的时候 如果不小心打错了commit -m 'xxx' xxx里面的内容的话,可以修改,命令是git commit --amend

apple:yunlu_meeting apple$ git commit -m 'delete redu'
//这时候发现打字还没打完 电脑卡了手贱 多按了回车,郁闷,于是再一次修改提交信息
apple:yunlu_meeting apple$ git commit --amend
//WTF,`Vi`编辑器遇到问题,
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

解决方法是

$ git config --global core.editor /usr/bin/vim -f

完整的终端打印如下:

apple:yunlu_meeting apple$ git commit --amend
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.
apple:yunlu_meeting apple$ git config --global core.editor  /usr/bin/vim -f 
apple:yunlu_meeting apple$ git commit --amend
[addChat e38cfe4] delete redundant key-values in HBuilder-Hello-Info.plist
 Date: Sat Oct 8 17:48:46 2016 +0800
apple:yunlu_meeting apple$ git push origin addChat:addChat
Counting objects: 198, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (114/114), done.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容