git commit -a confusion

前端 未结 4 716
面向向阳花
面向向阳花 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条回答
  •  无人及你
    2020-12-13 14:03

    this is a question about VIM and not git itself (if i'm not mistaken)

    VIM uses multiple modes, to exit insert mode hit ESC or ^C. to save and exit the file use ZZ, :x or :wq

    just to be complete: git commit -a will first add all tracked and changed files' contents to the index and then creates a commit (after specifying the commit message inside vim – or your editor of choice)

提交回复
热议问题