How to Use Conventional Commits
A guide to implementing the Conventional Commits specification for standardized Git history.
What is Conventional Commits?
Conventional Commits is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history, which makes it easier to write automated tools on top of it.
The Format
The standard format is: type(scope): subject. For example, "feat(api): add login endpoint". The scope is optional but provides context about the area of the codebase.
Common Types
Use "feat" for new features, "fix" for bug fixes, "docs" for documentation changes, "chore" for routine maintenance, and "refactor" for code restructuring.
Breaking Changes
If a commit introduces a breaking change, it must be indicated either by a "!" after the type/scope (e.g., feat(api)!: subject) or by including "BREAKING CHANGE:" in the footer.