There was a problem with the editor ‘vi’
在項目中通過git commit -m'modify message'
提交代碼,發現提交的modify message
不太準確,想要修改。使用git commit --amend
命令修改modify message
,在vim
中編輯完message
之後,w+q
退出的時候報錯且message
保存失敗,
錯誤信息如下:
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
在次執行git commit --amend
就OK了。
參考:
http://tooky.co.uk/there-was-a-problem-with-the-editor-vi-git-on-mac-os-x/