Show Menu
Cheatography

Conventional Commits 1.0 Cheat Sheet by

A specification for adding human and machine readable meaning to commit messages from https://www.conventionalcommits.org/en/v1.0.0

Descri­ption

A specif­ication for adding human and machine readable meaning to commit messages from Conven­tional Commits

Commit message structure

<ty­­pe­>[o­ptional scope]: <de­­sc­r­i­pt­­ion>

[optional body]

[optional footer]
A commit that has the text BREAKING CHANGE: at the beginning of its optional body or footer section introduces a breaking API change

Types

fix
Correct code issue (Patch)
-
feat
Introduce new feature (Minor)
-
BREAKING CHANGE
Breaking backward compat­ibility (Major)
-
build
Build system changes
Angular convention
chore
Mainte­nance or tooling
Angular convention
ci
Continuous integr­ation adjust­ments
Angular convention
docs
Docume­ntation changes made
Angular convention
style
Code style updates
Angular convention
refactor
Code restru­cturing done
Angular convention
perf
Perfor­mance improv­ement made
Angular convention
test
Testin­g-r­elated changes
Angular convention
Several types use words based on Angular's conven­tional commit.

Specif­ication

Commits MUST be prefixed with a type, which consists of a noun, feat, fix, etc., followed by the OPTIONAL scope, OPTIONAL !, and REQUIRED terminal colon and space.
The type feat MUST be used when a commit adds a new feature to your applic­ation or library.
The type fix MUST be used when a commit represents a bug fix for your applic­ation.
A scope MAY be provided after a type. A scope MUST consist of a noun describing a section of the codebase surrounded by parent­hesis, e.g., fix(pa­rser):
A descri­ption MUST immedi­ately follow the colon and space after the type/scope prefix. The descri­ption is a short summary of the code changes, e.g., fix: array parsing issue when multiple spaces were contained in string.
A longer commit body MAY be provided after the short descri­ption, providing additional contextual inform­ation about the code changes. The body MUST begin one blank line after the descri­ption.
A commit body is free-form and MAY consist of any number of newline separated paragr­aphs.
One or more footers MAY be provided one blank line after the body. Each footer MUST consist of a word token, followed by either a :<s­pac­e> or <sp­ace­># separator, followed by a string value (this is inspired by the git trailer conven­tion).
A footer’s token MUST use - in place of whitespace charac­ters, e.g., Acked-by (this helps differ­entiate the footer section from a multi-­par­agraph body). An exception is made for BREAKING CHANGE, which MAY also be used as a token.
A footer’s value MAY contain spaces and newlines, and parsing MUST terminate when the next valid footer token/­sep­arator pair is observed.
Breaking changes MUST be indicated in the type/scope prefix of a commit, or as an entry in the footer.
If included as a footer, a breaking change MUST consist of the uppercase text BREAKING CHANGE, followed by a colon, space, and descri­ption, e.g., BREAKING CHANGE: enviro­nment variables now take precedence over config files.
If included in the type/scope prefix, breaking changes MUST be indicated by a ! immedi­ately before the :. If ! is used, BREAKING CHANGE: MAY be omitted from the footer section, and the commit descri­ption SHALL be used to describe the breaking change.
Types other than feat and fix MAY be used in your commit messages, e.g., docs: update ref docs.
The units of inform­ation that make up Conven­tional Commits MUST NOT be treated as case sensitive by implem­entors, with the exception of BREAKING CHANGE which MUST be uppercase.
BREAKI­NG-­CHANGE MUST be synonymous with BREAKING CHANGE, when used as a token in a footer.
       
 

Comments

This is great, not seen Conventional Commits before but looks like something we should be considering for work!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Git Conventional Commit messages Cheat Sheet
          Git commit message Cheat Sheet

          More Cheat Sheets by finuex

          finuex Cheat Sheet