Skip to content

Instantly share code, notes, and snippets.

@vhscom
Forked from RangHo/git-commit-template
Created August 2, 2024 18:52
Show Gist options
  • Save vhscom/2f504509316ad918c5e03a3031b1ae69 to your computer and use it in GitHub Desktop.
Save vhscom/2f504509316ad918c5e03a3031b1ae69 to your computer and use it in GitHub Desktop.
Commit message template that conforms to the Conventional Commits standard.
# <type>(<scope>)!: <description> (72 characters maximum)
# |<--- preferably using up to 50 characters --->|<------------------->|
# Optional <body>
# |<------------- try limiting to 72 characters per line ------------->|
# Optional <footer>
# ----- END COMMIT MESSAGE -----
#
# Conventional Commits Cheatsheet (https://www.conventionalcommits.org)
#
# <type> indicates what kind of commit this is.
# It can be one of:
# - feat for new features introduced (i.e. MINOR in SemVer standard)
# - fix for bug-fixes (i.e. PATCH in SemVer standard)
# - build for changes in build system or environment
# - ci for configuring continuous integration systems
# - test for adding new tests or correcting defective tests
# - docs for changes in documentation only
# - refactor for rewriting or restructuring of code that does not affect API behavior
# - perf for performance-enhancing refactors
# - style for changes in code styles and no changes in logic
# - chore for miscellaneous tasks
# - revert for reverting commits made previously
#
# <scope> describes a section of the codebase where this change is applied and is optional.
# Note that allowed content of this section depends on the specific project.
# Issue identifiers are not valid scopes.
#
# Inserting "!" before the colon indicates that this commit introduces a breaking change.
# It is equivalent to a bump in MAJOR in SemVer standard.
# With this, the breaking change indicator in <footer> becomes optional.
#
# <description> contains a conceise description of the change.
# The content should be in imperative mood, as if "This commit will..." is prepended.
# Do not capitalize the beginning of the sentence, and full stop (.) is omitted.
#
# <body> provides additional contextual information about the code changes and is optional.
# Mutliple paragraphs separated by an empty line are allowed here.
# Sentences should be in imperative mood with proper capitalization and full stops (.).
#
# <footer> is a list of key-value pairs that store "metadata" of a commit.
# There are three types of a footer:
# - Breaking change indicator verbatim "BREAKING CHANGE:", followed by a <description>
# - Automatic issue management such as "Close #123", "Reference #123", "See #123", etc.
# - Email-like metadata such as "Signed-off-by:", "Co-authored-by", etc.
#
# There are three exceptions to the subject line rules:
# 1. "Initial commit" for the first commit in a git repository
# 2. "Merge branch..." as it is the default commit message for automatic merges
# 3. "Revert..." as it is the default commit message for reverting commits
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment