Commit Messages
Commit messages are the post-it notes of coding – concise and clear. Clear commit messages keep our project history tidy and understandable! 🌱💬🔍
🧐 Getting started with Git? Here's the Git Handbook.
Writing a commit message
git commit -m <message>
git commit -m <title> -m <description>
Quick Notes
- Atomic commits: Code changes should be reasonably small and atomic.
- Use Active Voice when writing commit messages.
- Keep the commit messages short and unambiguous.
Conventional Commits
Conventional Commit is a formatting convention that provides a set of rules to formulate a consistent commit message structure like so:
<type> [optional scope]: <description>
[optional body]
[optional footer(s)]
The commit type can include the following:
feat
– a new feature is introduced with the changesfix
– a bug fix has occurredchore
– changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)refactor
– refactored code that neither fixes a bug nor adds a featuredocs
– updates to documentation such as a the README or other markdown filesstyle
– changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on.test
– including new or correcting previous testsperf
– performance improvementsci
– continuous integration relatedbuild
– changes that affect the build system or external dependenciesrevert
– reverts a previous commit
Example:
fix: fix foo to enable bar
This fixes the broken behavior of the component by doing xyz.
BREAKING CHANGE
Before this fix foo wasn't enabled at all, behavior changes from <old> to <new>
Closes D2IQ-12345
references: