-
-
Notifications
You must be signed in to change notification settings - Fork 284
Writing a commit message
Erik Nyquist edited this page Jul 13, 2016
·
23 revisions
A good commit message should have two basic parts; a subject line, and a description (if required). The subject line is always the first line, and the description is always separated from the subject with a blank line.
<Subject: brief one-liner describing your changes>
<Description: if more detail is needed, then skip a line
and put it in the description. However, if you don't think
you need it, then a one-line commit message is OK>
Some important things to remember:
- Don't let lines in your commit message run too long; keep them under 80 characters please.
- Always use imperative mood for commit messages, as if you are commanding the code base to change for you; instead of saying "I added a new feature" and "I fixed the bug", say "Add a new feature" and "Fix the bug".
- Make sure your commit message contains an accurate summary of your changes (for example, "Made some improvements" is a bad commit message). If you're finding it difficult to summarise your changes in one commit message, then perhaps you should consider breaking the change up into multiple commits.