Skip to content

Instantly share code, notes, and snippets.

@andrejb-dev
Last active March 10, 2020 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrejb-dev/df9b496bdd35fcba0b5c92ec0a30032e to your computer and use it in GitHub Desktop.
Save andrejb-dev/df9b496bdd35fcba0b5c92ec0a30032e to your computer and use it in GitHub Desktop.

Commit convention / guideline

Commit Message Format

Each commit message consists of a header, a body and a footer. The header is mandatory The header has a special format that includes a type, a scope and a subject:

<type>[optional scope]: <subject>
<BLANK LINE>
[optional body]
<BLANK LINE>
[optional footer]

The header is mandatory and the scope of the header is optional. The footer should contain any information about Breaking Changes and is also the place to a closing reference to an issue if any.

Type

  1. fix: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).
  2. feat: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in semantic versioning).
  3. BREAKING CHANGE: a commit that has the text BREAKING CHANGE: at the beginning of its optional body or footer section introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of commits of any type.
  4. Others: commit types other than fix: and feat: are allowed, for example:
    • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
    • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
    • docs: Documentation only changes
    • perf: Performance improvements
    • refactor: A code change that neither fixes a bug nor adds a feature
    • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
    • test: Adding missing tests or correcting existing tests

Examples

Appears under "Features" header, compiler subheader:

feat(compiler): add 'comments' option

Appears under "Bug Fixes" header, v-model subheader, with a link to issue #28:

fix(v-model): handle events on blur

close #28

Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:

perf(core): improve vdom diffing by removing 'foo' option

BREAKING CHANGE: The 'foo' option has been removed.

Commit message with description and breaking change in body:

feat: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used for extending other config files

Commit message with no body:

docs: correct spelling of CHANGELOG

Commit message with scope:

feat(lang): add polish language

Commit message for a fix using an (optional) issue number:

fix: correct minor typos in code

see the issue for details on the typos fixed

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