Aborting commit due to empty commit message

后端 未结 20 2046
[愿得一人]
[愿得一人] 2020-12-04 09:45

As a newbie git user, when I try to commit my work with

git commit -a -v

and I enter a commit message in my editor, I close the file, and g

20条回答
  •  情书的邮戳
    2020-12-04 10:08

    It expects a commit message.

    For vim: ( I'm a newbie as well. I only worked with vim so far)

    After your command,

    git commit -v
    

    You will be directed to a file with the name

    ".git/COMMIT_EDITMSG"

    That opens up in your editor (which in my case is vim)

    You will find a lot of commented text that looks exactly like what you saw when you did

    git status  OR
    git diff
    

    If you notice, you can see an empty line on top - where it expects a commit message. You may type the commit message here and save & quit the editor. It's done!

提交回复
热议问题