How do I disable this annoying enforcement of comments on git
I want to be able to commit without having to say something about why I am committing. Is there a way to prevent git from committing because I do not f开发者_JAVA技巧ill in a comment. I could do this with SVN without a problem, but I can't with git for some reason.
Ted.
From git-commit manual
git commit --allow-empty-message
Take a look at the answer to this SO question:
- Git commit with no commit message
Note that, though it might seem annoying at first, it's better to train yourself to actually enter comments. The above question also has links that debate/explain why this might be important.
Whilst there are times when one feels like no comment should be necessary, after many years one learns of the regular fallibility of memory. Trying to explain what you did on that particular code commit 6 months from now will be easier if you give yourself a clue.
What this means is that you should have at least have a few standard codewords that you can quickly type to aid later clarification. Here I'm thinking of:
- "CoB wip" (close of business work in progress), or
- "marginal" (it works, but only just), or
- "buggy" (it works somethimes ;-), etc.
Having a few cheat sheet codewords is an easy win that uses almost no effort, and will satisfy all the critics (management, co-workers, reviewers, fellow SO readers;-) and -m"cob wip"
is quicker to type & shorter than --allow-empty-message
!
精彩评论