Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tif-calin/62ea738bee0a4a5b0a63de3c07704d30 to your computer and use it in GitHub Desktop.
Save tif-calin/62ea738bee0a4a5b0a63de3c07704d30 to your computer and use it in GitHub Desktop.
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>)!: <subject>

  • <scope> is optional
  • ! is optional. It is used when there is a BREAKING CHANGE (aka <major> in semver). Also see this discussion on what is a "breaking change". Or the FluidFramework docs
  • <subject> summary should be in present tense

Examples

test: Add tests for class <PeriodicPayment>

feat(landing): Add hat wobble

feat(1rm)!: Replaces formula for election validation

More <type>s

Note

Some guides restrict all messages to just feat and fix. By default you should opt to use these along with scopes and only reach for others if it really makes sense. E.g. you can use feat(docs) instead of docs)

  • feat: (new feature or functionality, including tests. Not necessarily user-facing)
  • fix: (bug fix of existing feature or functionality. Not necessarily user-facing)
  • style: (code-wise, not CSS! formatting, missing semi colons, renaming variables, etc) [see discussion about distinction between refactoring vs rewriting]
  • dev: (releases, updating grunt tasks, docker configs, deployment scripts, dependency management, etc)

What other guides suggest

  • joshbuchea: chore, docs, feat, fix, refactor, style, test
  • Here-Be-Pythons: bugs, depl, docs, feat, front, misc, perf, rfct, style, tests, ver
  • Angular: build, ci, docs, feat, fix, perf, refactor, style, test
  • JSHint: chore, docs, feat, fix, test
  • other: deprecate, remove, revert, wip

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment