在用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.