用Vim输入Git commit消息的问题 [英] Problems with entering Git commit message with Vim
问题描述
操作系统:Windows
我写了
$ git commit
然后
<
我写了一些文字,例如
已添加表单验证
按Enter键不提交。然后我按下Shift + Enter,Ctrl + Enter,Alt + Enter - 仍然没有提交。
我觉得它很愚蠢,但我该怎么做?
如果是VIM for Windows,您可以执行以下操作:
:wq
Enter 或 ZZ
。
请注意,在VIM中,通常有几种方法可以完成一件事。虽然这里有一点点区别。 :wq
Enter 总是在关闭它之前写入当前文件,而 ZZ
,:x
Enter ,:xi
Enter ,:xit
Enter ,:exi
Enter 和 :退出
回车只在文档被修改时才写入。
所有这些同义词只有不同数量的按键。
OS: Windows
I write
$ git commit
then
"# Please enter the commit message"
I write some text, like
"Form validation added"
Press Enter and not commited. Then i press Shift+Enter, Ctrl+Enter, Alt+Enter - still not commited.
I think its stupid trouble, but What i must to do?
If it is VIM for Windows, you can do the following:
- enter your message following the presented guidelines
- press Esc to make sure you are out of the insert mode
- then type
:wq
Enter orZZ
.
Note that in VIM there are often several ways to do one thing. Here there is a slight difference though. :wq
Enter always writes the current file before closing it, while ZZ
, :x
Enter, :xi
Enter, :xit
Enter, :exi
Enter and :exit
Enter only write it if the document is modified.
All these synonyms just have different numbers of keypresses.
这篇关于用Vim输入Git commit消息的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!