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

在用git提交的時(shí)候 如果不小心打錯(cuò)了commit -m 'xxx' xxx里面的內(nèi)容的話,可以修改,命令是git commit --amend

apple:yunlu_meeting apple$ git commit -m 'delete redu'
//這時(shí)候發(fā)現(xiàn)打字還沒打完 電腦卡了手賤 多按了回車,郁悶,于是再一次修改提交信息
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.
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容