Aborting commit due to empty commit message

后端 未结 20 2014
[愿得一人]
[愿得一人] 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 09:58

    To begin with, make sure your git is correctly configured to open some kind of editor prompt (visual studio / sublime / notepad++ / atom etc) in order to proceed further.

    • For my case I configured my git to use visual studio in Ubuntu environment.
    • I tried committing a change, it failed with given failure.
    • Then I looked at my .gitconfig file and found out my editor was missing -w parameter
    • I ran git config --global core.editor "code -w" command and rechecked my .gitconfig file, noticed the -w was added there correctly.
    • Tried committing the change again and it worked for me.

    Hope this helps for some other newbie's like myself.

提交回复
热议问题