Learn the standard commit types: complete reference
Each type has a precise meaning. Using them consistently makes git log immediately informative and enables tooling like automatic changelogs. Here is the full reference table:
feat β A new feature visible to users (triggers MINOR in semver)
Examples: feat(auth): add Google OAuth login
feat(api): expose /v2/users endpoint
fix β A bug fix that corrects existing behavior (triggers PATCH in semver)
Examples: fix(cart): correct item count when quantity is zero
fix(login): prevent null crash on empty email
chore β Maintenance tasks that do NOT affect production code or public API
Examples: chore(deps): update lodash to 4.17.21
chore(build): upgrade webpack config
chore(.gitignore): add .DS_Store
docs β Documentation changes only - no code logic
Examples: docs(readme): add installation steps
docs(api): document /users query params
style β Formatting, whitespace, semicolons - zero logic change
Examples: style(button): apply Prettier formatting
refactor β Code restructuring without adding features or fixing bugs
Examples: refactor(auth): extract token logic to service layer
test β Adding or updating automated tests
Examples: test(cart): add unit tests for discount calculation
ci β Changes to CI/CD pipeline configuration
Examples: ci(github): add automated deployment on tag push
perf β Performance improvements
Examples: perf(images): lazy-load below-the-fold thumbnails
revert β Reverts a previous commit
Examples: revert: feat(auth): add Google OAuth loginWhen in doubt between chore and refactor: if a user or public API is unaffected and it's housekeeping (deps, tooling, config), use chore. If it's restructuring internal code logic, use refactor.
