Skip to content

Instantly share code, notes, and snippets.

@roydejong
Last active January 22, 2021 14:04
Show Gist options
  • Save roydejong/f73972da2cad8dcced7dc667632eb53f to your computer and use it in GitHub Desktop.
Save roydejong/f73972da2cad8dcced7dc667632eb53f to your computer and use it in GitHub Desktop.
Commit message conventions

Goals

Consistent commit messages that are easily readable & searchable.

Syntax

commit_type(project_component): [issue_reference] short_message 

optional_extended_message

commit_type

Commit type is a short keyword that describes what type of commit it is. One of:

Primary types (affects functionality)

  • feat: Adds new user-facing functions or features.
  • fix: Fixes existing functionality.
  • tweak: Optimizes existing functionality without adding new features.

Secondary types (do not affect functionality)

  • maint: Maintenance tasks, related to the project, dependencies, build scripts, repository, etc.
  • docs: Updates to documentation, readme, etc.
  • refactor: Internal changes to the code (organizing, cleaning, etc).
  • test: Changes or additions to tests.

Special types

  • revert: For revert commits.

project_component

Short, searchable and consistent description of a project name. Follow per-project conventions.

issue_reference

A reference to issue or ticket number, if applicable.

short_message

Short descriptive commit message. Should actively answer a question to the reader: "what will change in the project if I pull in this commit?".

For example: "add password reset function", "add polish language", etc.

optional_extended_message

Detailed description of the commit, with as much detail as you think is relevant to collaborators.

Good example

feat(lang): [#123] add polish language

Adds locale files for the Polish language (pl_PL), and modifies the UI to add it as an option to the language selector.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment