Git commit message
A short hint for writing commit messages
A Git commit should contain a whole idea of completed work.
[1] Your completed work idea can be communicated well in a Git commit message by following Chris Beams´[2] suggestion of ending the following sentence:
If applied, this commit will
Your commit subject line will come here
Example Git commit messages:
- Repair CSS class assignment for images
- Remove underlines for slide navigation
- Increase line height by a factor of 0.1
Chris has a checklist to follow along when writing a Git commit message:
- Separate the subject from the body with a blank line
- Use the imperative mood in the subject line
- Limit the subject to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Wrap the body at 72 characters
- Use the body to explain what and why, not how
In the context of Git I can recommend David Demaree´s book Git for Humans.[3] It´s eight years ago I´ve read it, but I remember it was of great help for understanding Git.
Dealing with Emergencies in Git, Emma Jane Westby, 24 Ways, 2014 ↩︎
How to Write a Git Commit Message, Chris Beams, 2014 ↩︎
Git for Humans, David Demaree, A Book Apart, 2016 ↩︎
Comments