git commit -a confusion

前端 未结 4 694
面向向阳花
面向向阳花 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:14

    As others have said, Vim is being opened so you an add a message with information about the changes you're committing. It seems the default editor on your system is Vim. Git is set up so that it will include whatever message you type and save in Vim, after you close Vim with :wq, :x, or some other command.

    In addition to method Andrew Myers suggests of changing the editor being called by Git, you can include a simple message on the command line with something like this:

    git commit -am 'This is my message for the commit. . . '
    

    If you do it that way Git will not bother you by opening a text editor at all.

提交回复
热议问题