Conventional Commits format
${type}(${scope}): ${subject} ${body} ${footer}
Where:
$type is one of:
External-facing stuff, important to publish to users.
- β¨ or β or π feat or new: New feature. Correlates to MINOR in Semantic Versioning.
- feat: add beta sequence
- π or π fix: Bug fix. Correlates to PATCH in Semantic Versioning.
- fix: remove broken confirmation message
- π security: Security-related fix, i.e. important to highlight in changelog.
- β‘ perf: Change that improves performance. Sometimes a subset of refactor.
- βοΈ or π οΈ conf: Configuration change, e.g. modify a default.
- π or π¬ i18n or l10n: Internationalization, localization, or translation addition, fix.
- βΏ a11y: Accessibility.
- π log: Logging or printing-related added.
Internal repository-related:
- π initial: Initial commit of something, may not yet work.
- βͺ revert : Revert of previous behavior, fix, or feature
- β
or π¨ or π§ͺ: test: Adding new test or making changes to existing test
- test: ensure Tayne retains clothing
- π deps: Add, upgrade, or anything to do with an external dependency.
- π merge: Merge from another branch.
- π§ wip: Work-in-progress.
Internal changes, not user-facing.
- π§ chore: Code change that external user won't see and does not impact a feature (e.g. change to .gitignore file)
- chore: add Oyster build script
- π· ci: CI-related change, subset of chore.
- π ci : Fix CI
- π¦ build: Build related changes (e.g. cmake, Broccoli, grunt). Subset of chore.
- π deploy or release: New version, snapshot, or deploy.
Refactor-related, i.e. does not add new features.
- β»οΈ or π¨ or π οΈ refactor: A code that neither fix bug nor adds a feature. (e.g. semantic changes like renaming a variable/ function name)
- refactor: share logic between component1 and component2
- βοΈ comments: Internal documentation not otherwise exported, e.g. comments. Subset of refactor.
- π docs: External documentation. Includes API documentation (docstrings, doxygen). Subset of refactor.
- docs: explain hat wobble
- π¨ style: Style change, like improving structure or formatting. Subset of refactor.
- style: convert tabs to spaces
- style: format w/ black
- π rename: Move files. Subset of refactor.
- π remove: Remove deprecated code no longer used. Keep as a separate commit to make it easy to revert. Subset of refactor.
- π lint: linting, typing, casting fix. Subset of refactor.
Other:
- π review: Change from code review.
- π or π‘ telemetry, analytics, metrics, or logging
- β removal
- β addition
- π bookmark, tag
- π metadata
- π metadata or index
- π‘ idea, comment, etc
- π or π₯ hotfix
- π© shitcode, needs refactor
- π₯ breaking-change
- π₯ contributor or sponsor update
- π cherry-pick'ed commit
- βΈοΈ k8s
- π docker or container
- β Add but not β Added
- β Fix but not β Fixed
- β right-pointing arrow
$scope refers to the module or component. Examples:
- init
- runner
- watcher
- config
- web-server
- proxy
$subject is the first line of the commit message, and:
- 50c soft limit, 70c hard limit
- Uses imperative, present tense. "add" vs "adds" or "added", "fix" vs "fixes" or "fixed".
- Do not end with period
- Finish this sentence: If applied, this commit will ${subject}
$body should:
- Focus on WHY and WHAT, not on HOW.
- Uses imperative, present tense. "add" vs "adds" or "added", "fix" vs "fixes" or "fixed".
- Includes motivation for the change, and contrasts previous behavior/implementation vs new behavior/implementation
- Describe what the commit will do, not what you did.
- Wrap at 72c.
$footer should:
Be one per line, and follow the git trailer format. That is, each line is a keyβvalue pair, separated by either :<space> or <space>#.
Closes #${BUG_NO}, e.g. Closes #123 if the commit closes an issue in your issue tracker.
Fix #${BUG_NO}, e.g. Fix #123 if the commit closes an issue in your issue tracker.
BREAKING-CHANGE: ${description} to describe this commit breaks previous behavior/interface.
Signed-off-by, Acked-by, Cc, Reported-by, Tested-by, Reviewed-by as described by Gerrit, based on Linux' SubmittingPatches guide.
- Co-authored-by (gcc)
- See-also: commit hash or URL
See also:
Emoji was taken from folke/devmoji and gitmoji.dev
Good examples:
Semantic Branch Names
https://gist.github.com/seunggabi/87f8c722d35cd07deb3f649d45a31082
- feature/: New feature
- bugfix/: Bug fix
- docs/: Documentation change
- style/: Style change
- refactor/: Refactor
- test/: Adding tests, refactoring tests, etc.
- chore/: Chore