Aborting commit due to empty commit message

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

    If you want to commit with a proper (long, multi-line comment) documentation, but don't want the -m option, what you can do (and that I do when preparing my commits) is to:

    • write your documentation (while you are making the changes) in a separate file 'doc-commit' (or whatever name you want to call it)
    • commit with a 'git commit -a -F /path/to/doc-commit')

    In short, use a separate file (which can be at any path you want) as your commit message.

提交回复
热议问题