How to write git commit message

The first line in the commit message is the title or the subject. The subsequent lines are designated as body.

  1. Include the issue number in the subject / title as #<issue number>. This will automatically link the commit to the issue timeline in GitHub.
  2. Separate subject from body with a blank line
  3. Limit the subject line to 50 characters
  4. Capitalize the subject line
  5. Do not end the subject line with a period
  6. Use the imperative mood in the subject line
  7. Wrap the body at 72 characters
  8. Use the body to explain what and why vs. how

For more explanation, see this reference: https://chris.beams.io/posts/git-commit/#seven-rules