These commit rules are designed to ensure consistency and clarity in our version control history. By following these guidelines, we can maintain a clean and understandable project history.
- feat: Commits that add a new feature
- Example:
git commit -m "feat(profile): add button for update call"
- Example:
- fix: Commits that fix a bug
- Example:
git commit -m "fix(login): correct authentication error"
- Example:
- refactor: Commits that restructure code without changing behavior
- Example:
git commit -m "refactor(database): optimize query performance"
- Example:
- perf: Commits that improve performance
- Example:
git commit -m "perf(api): reduce response time"
- Example:
- style: Commits that do not affect the meaning of the code (white space, formatting, etc.)
- Example:
git commit -m "style(css): format header styles"
- Example:
- test: Commits that add or correct tests
- Example:
git commit -m "test(api): add tests for user endpoint"
- Example:
- docs: Commits that affect documentation only
- Example:
git commit -m "docs(readme): update commit rules"
- Example:
- build: Commits that affect build components like build tools, CI pipeline, dependencies, etc.
- Example:
git commit -m "build(ci): add new deployment script"
- Example:
- chore: Miscellaneous commits (e.g., modifying .gitignore)
- Example:
git commit -m "chore(gitignore): add new patterns"
- Example:
Only one type per commit.
The commit scope should be a noun describing a section of the codebase, surrounded by parentheses.
Example:
git commit -m "feat(profile): add button for update call"
Link to Jira by writing the number of the task that was solved.
Example:
git commit -m "(JIRA-231) feat(dashboard): add sign-out button"
Use !
to draw attention to breaking changes.
Example:
git commit -m "feat!: send an email to the customer when a product is shipped"
Write commit messages in the present tense, not past tense.
Examples:
git commit -m "refactor: change the text" # Correct
git commit -m "refactor: changed the text" # Incorrect