Skip to content

Instantly share code, notes, and snippets.

@stevenlafl
Last active December 15, 2025 14:57
Show Gist options
  • Select an option

  • Save stevenlafl/b85db5d134a1d9d21988505dd7321c86 to your computer and use it in GitHub Desktop.

Select an option

Save stevenlafl/b85db5d134a1d9d21988505dd7321c86 to your computer and use it in GitHub Desktop.
Semantic commit messages

Semantic Commit Messages

Format

<type>(<optional scope>): <short summary>

  • Present tense, imperative mood
  • User‑focused, concise

Core Types

feat — New user‑visible functionality

  • Adds a new capability or extends behavior
  • Examples:
    • feat: add CSV export
    • feat(ui): allow sorting by date
    • feat(api): expose metrics endpoint

fix — Bug fix

  • Corrects incorrect or broken behavior
  • Examples:
    • fix: prevent crash on empty input
    • fix(auth): refresh token correctly

docs — Documentation only

  • README, comments, guides, examples
  • Examples:
    • docs: add usage example
    • docs(readme): update installation steps

refactor — Internal code changes (no behavior change)

  • Renaming, restructuring, extracting logic
  • Examples:
    • refactor: extract validation logic
    • refactor(core): rename misleading variables

test — Tests and benchmarks

  • Adding, updating, or refactoring tests
  • Examples:
    • test: add edge cases for parser
    • test(bench): add performance benchmarks

style — Formatting only

  • Whitespace, linting, import order
  • Examples:
    • style: run formatter
    • style(css): normalize indentation

chore — Maintenance & cleanup

  • No user‑visible behavior change
  • Examples:
    • chore: remove unused files
    • chore(deps): update lodash
    • chore: bump version to 0.0.9

Optional Types

build — Build system or tooling

  • build: update webpack config

ci — CI/CD configuration

  • ci: add GitHub Actions workflow

perf — Performance improvements

  • perf: reduce query execution time

revert — Revert a commit

  • revert: feat(auth): add password reset

Breaking Changes

Use ! after type or scope:

  • feat(api)!: remove legacy endpoint

Common Scenarios

  • Dependency update → chore(deps)
  • Delete unused code → chore
  • Benchmarks → test
  • Version bump → chore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment