📎 Webclip
How to write a good commit message
A commit message is a short description of the changes made before committing. The post says good commit messages help collaborators and also help the author keep track of what changed in a commit.
It gives a format with type, subject, body, and footer. The subject should be under 50 characters, start with a capital letter, and use the imperative. The body is optional, should explain what changed and why, and each line should stay under 72 characters. The footer is also optional and can reference an issue ID.
Reading notes#
- A commit message is a short description of changes added before committing.
- Good commit messages help both collaborators and the author track what changed.
- The format used in the post is type, subject, body, and footer.
- The type can be feat, fix, docs, style, refactor, test, or chore.
- The subject should stay under 50 characters, start with a capital letter, and use the imperative.
- The body explains what changed and why, and it is optional for simpler commits.
- A blank line is required between subject and body, and each body line should stay under 72 characters.
- The footer is optional and is mainly used to reference an issue tracker ID.
