
Git Commit Message Convention
Planted:
Tended:
Status: decay
Hits: 246
Conventional Commits is a convention for adding human and machine readable meaning to commit messages.
Why
- ▪ Improves a team's shared understanding of a codebase by better communicating what a commit did through:
- ▪ structure,
- ▪ clarity (through use of keywords) and
- ▪ consistency.
- ▪ Makes it easier to write automated tools on top of:
- ▪ automatically generating CHANGELOGs,
- ▪ automatically determining a semantic version bump (based on the types of commits landed) and
- ▪ triggering build and publish processes based on commit type.
Structure
The convention structures a commit with 2 mandatory fields and 3 optional.
> <type>[scope]: <description>> [body]> [footer(s)]_Examples
A bug fix
> git commit -m "fix: broken home link"_A new feature with a breaking change
In Bash, you can use single quotes to write a message on multiple lines.
> git commit -m 'feat: add user-data API endpoint> > BREAKING CHANGE: remove user-name endpoint'_A new feature with scope provided
> git commit -m "feat(user-profile): add user-avatar API endpoint"_
Message Keywords
| Key Word | Indicates | Correlates with SemVer |
|---|---|---|
| build | Build system changes | |
| ci | CI configuration changes | |
| docs | Documentation changes | |
| feat | Introduce a new feature | MINOR v1.0.0 -> v1.1.0 |
| fix | Patch a bug | PATCH v1.0.0 -> v1.0.1 |
| perf | Performance improvements | |
| test | Add missing / correct tests | |
| refactor | ||
| BREAKING CHANGE | Introduce a breaking API change | MAJOR v1.0.0 -> v2.0.0 |
Information about SemVer can be found here.
Feedback
Have any feedback about this note or just want to comment on the state of the economy?



