git commit - 一个混乱 [英] git commit -a confusion
问题描述
我使用Git Bash,并试图找出当我输入'git commit -a'时发生了什么。
I am using Git Bash and am trying to figure out what is happening when I type 'git commit -a'.
看起来像VIM打开编辑我的提交消息,但我如何保存并实际完成此提交?我输入编辑器并按回车键,但它只是创建另一行。
Looks like VIM opens up to edit my commit message but how do I save and actually complete this commit? I type in the editor and hit enter but it just creates another line.
供参考:我在我的Mac上使用VM Fusion,因此我的一些密钥可能有点不同
FYI: I am using VM Fusion on my mac so some of my keys might be a little different
推荐答案
只需离开VIM(命令模式 - > :wq
)。
Just leave VIM (command mode -> :wq
).
-a
标志的工作方式如下:
-a
flag works like:
git add -u
git commit ...
-m
标志指定提交消息。该消息是必需的,所以如果你不通过( git commit -m我的消息
),默认的文本编辑器将被打开(你可以在git配置中修改它),你必须写一个提交信息,然后保存并退出编辑器。
-m
flag specifies commit message. That message is mandatory so if you don't pass that (git commit -m "My message"
) the default text editor will be opened (you can change it in git configuration) and you'll have to write a commit message, then save and quit the editor.
这篇关于git commit - 一个混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!