git commit -a confusion

前端 未结 4 717
面向向阳花
面向向阳花 2020-12-13 13:34

I am using Git Bash and am trying to figure out what is happening when I type \'git commit -a\'.

Looks like VIM opens up to edit my commit message but how do I save

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 14:01

    Just leave VIM (command mode -> :wq).

    -a flag works like:

    git add -u
    git commit ...
    

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

提交回复
热议问题