Git Conventional Commit Standards
Guidelines
When you want to commit and push changes you made on merge request, below are some rules to follow:
- Commit message must represent what you do on that commit.
- Using a short, descriptive title in the first line of the commit message.
- Using the imperative mood in the commit title ("Fix bug" instead of "Fixed bug").
- Referencing issue numbers or identifiers in the commit message to link it with relevant project management systems (e.g., "Fixes #123").
- Providing more details in the body of the commit message, if necessary.
- Use active verbs, e.g.
- adding special abilities.
- Don’t commit files that you’ve not recognized, or you don’t know the changes. Stage and commit only for files that you’ve changed and know about it.
Commit Formats
<type>(<optional scope>):<subject>
empty separator line
<optional body>
empty separator line
<optional footer>
Message subject (First line)
The subject contains a succinct description of the change.
- Is a mandatory part of the format
- Use the imperative, present tense: "change" not "changed" nor "changes"
- Think of
This commit will <subject>
- Think of
- Don't capitalize the first letter
- No dot (.) at the end
Types (First line)
featCommits, that adds a new featurefixCommits, that fixes a bugassetsCommits, that add assetsrefactorCommits, that rewrite/restructure your code, however does not change any behaviourperfCommits are specialrefactorcommits, that improve performance
testCommits, that add missing tests or correcting existing testsdocsCommits, that affect documentation onlybuildCommits, that affect build components like build tool, ci pipeline, dependencies, project version,opsCommits, that affect operational components like infrastructure, deployment, backup, recovery,draftCommits, that implement tasks but not yet finishedchoreMiscellaneous commits e.g. modifying.gitignore
Scopes (First line)
The scope provides additional contextual information.
- Is an optional part of the format
- Allowed Scopes depends on the specific project
- Don't use issue identifiers as scopes
Body (Second line)
The body should include the motivation for the change and contrast this with previous behavior.
- Is an optional part of the format
- Use the imperative, present tense: "change" not "changed" nor "changes"
- This is the place to mention issue identifiers and their relations
Footer (Third line)
- Is an optional part of the format
- optionally reference an issue by its id.
- Breaking Changes should start with the word
BREAKING CHANGES:followed by space or two newlines. The rest of the commit message is then used for this.
Examples
EXAMPLES
feat(store): Implement Store Mechanic
- Implement store buy coins mechanic
- Integrate buy store coin API
feat(shopping cart): add the amazing button
empty
refers to JIRA-1337
No Comments