Aborting commit due to empty commit message

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

    solution for commit error

    As I shown above there is a commit field which you need to enter while committing, this is basically for version control and understanding the changes for each commit.

    If you don't enter this you will get the error :Aborting commit due to empty commit message

    Note: the above works only in Rstudio commit and pulling the files.

    0 讨论(0)
  • 2020-12-04 10:02

    The git does not allows commit without message specified. Have you specified the commit message in commit dialog?

    Note that the lines starting with # are treated as comment by Git and are not considered as comments and ignored by Git.

    0 讨论(0)
  • 2020-12-04 10:04

    Make sure to sure a capital W.

    git config --global core.editor "open -a 'Sublime Text 2' -W"

    or use the following command to replace an existing one that isn't working properly.

    git config --replace-all core.editor "open -a 'Sublime Text 2' -W"

    0 讨论(0)
  • 2020-12-04 10:05

    I was having this problem. I just installed 1.8.0 earlier, and I found I had to modify the above slightly. I'm very much new at all of this, but essentially it seems that, when committing, it'll use content.editor, not core.editor, at least if you have something set for content.editor.

    So, it was

    git config --global content.editor "pico -w"
    

    that finally let me commit! Obviously, of course, use whatever editor you use.

    Hope this helps somebody someday!

    0 讨论(0)
  • 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!

    0 讨论(0)
  • 2020-12-04 10:10
    git config --global core.editor "subl -w" -F 
    

    This helped me after lots and lots of trial and error, hope someone finds it useful.

    I had already symlinked sublime 3 to use as subl command.

    I am completely clueless, for why -F flag outside the " " worked.

    0 讨论(0)
提交回复
热议问题