About git commit message generator
Conventional Commits is a simple format for commit messages that tools can read to build changelogs and decide version bumps.
Format
The pattern is type(scope): description. For example fix(login): handle empty password. Common types are feat, fix, docs, style, refactor, test and chore.
Writing good messages
- Use the imperative: 'add', not 'added'.
- Keep the first line under about 72 characters.
- Explain why in the body when it is not obvious.
- Add BREAKING CHANGE: in the footer for incompatible changes.
A worked example
feat(cart): add coupon code field on the first line, then a blank line and a short body that says why the change was made, such as 'Customers asked to apply discounts at checkout'. A footer may include Closes #123 to close an issue automatically.
Benefits of the convention
- Tools can build changelogs from commit types.
- Semantic versioning can be automated: fix means a patch, feat a minor and a breaking change a major.
- Reviewers understand the purpose of each commit quickly.
