Type :q!输入
(即冒号,字母q,感叹号,进入),这告诉Vim放弃任何更改并退出)
Git会回应:
由于提交消息为空而终止提交
你可以再次自由提交使用:
git commit –m "your comment here"
Alternative 2 – Use Vim to write a comment
Follow the following steps to use Vim for writing your comments
Press i to enter Edit Mode (or Insert Mode).
That will leave you with a blinking cursor on the first line. Add your comment.
Press Esc to make sure you are not in edit mode (you can press Esc several time if you are uncertain)
Type :wqenter
(that is colon, letter w, letter q, enter), this will tell Vim to save changes and exit)