Skip to content

Instantly share code, notes, and snippets.

@anthonyalvarez
Created June 10, 2019 20:01
Show Gist options
  • Select an option

  • Save anthonyalvarez/bda4b32ca17d7f54b238b89cb1af9c79 to your computer and use it in GitHub Desktop.

Select an option

Save anthonyalvarez/bda4b32ca17d7f54b238b89cb1af9c79 to your computer and use it in GitHub Desktop.
Sample Git Commit Message Template
type: subject
body
footer
# ========= INSTRUCTIONS FOR USE ============4950
#
# The Type
# The type is contained within the title
#
# - feat: a new feature
# - fix: a bug fix
# - docs: changes to documentation
# - style: formatting, missing semi colons, etc; no code change
# - refactor: refactoring production code
# - test: adding tests, refactoring test; no production code change
# - chore: updating build tasks, package manager configs,
# etc; no production code change
# ================================================================7172
# The Subject
# Subjects should be no greater than 50 characters,
# should begin with a capital letter
# and do not end with a period.
# Use an imperative tone to describe what a commit does,
# rather than what it did.
# For example, use change; not changed or changes.
# ================================================================7172
# The Body
# Not all commits are complex enough to warrant a body,
# therefore it is optional and only used when a commit
# requires a bit of explanation and context. Use the
# body to explain the what and why of a commit, not the how.
# When writing a body, the blank line between the title
# and the body is required and you should limit the length
# of each line to no more than 72 characters.
#
# The Footer
# The footer is optional and is used to reference issue tracker IDs.
#
# ======================= SAMPLE COMMIT ===========================7172
#
# feat: Summarize changes in around 50 characters or less
#
# More detailed explanatory text, if necessary. Wrap it to about 72
# characters or so. In some contexts, the first line is treated as the
# subject of the commit and the rest of the text as the body. The
# blank line separating the summary from the body is critical (unless
# you omit the body entirely); various tools like `log`, `shortlog`
# and `rebase` can get confused if you run the two together.
#
# Explain the problem that this commit is solving. Focus on why you
# are making this change as opposed to how (the code explains that).
# Are there side effects or other unintuitive consequenses of this
# change? Here's the place to explain them.
#
# Further paragraphs come after blank lines.
#
# ======================= SAMPLE COMMIT END =======================7172
#
# - Bullet points are okay, too
#
# - Typically a hyphen or asterisk is used for the bullet, preceded
# by a single space, with blank lines in between, but conventions
# vary here
#
# If you use an issue tracker, put references to them at the bottom,
# like this:
#
# Resolves: #123
# See also: #456, #789
#
# This work adapted from https://udacity.github.io/git-styleguide/
#
# Git Commit Message Template Setup instructions:
#
# Choose favorite text editor and set inside Git Global config.
#
# Examples:
# $git config --global core.editor emacs
# $git config --global core.editor nano
# $git config --global core.editor vi
# $git config --global core.editor vim
# $git config --global core.editor “code --wait”
# $git config --global commit.template ~/.gitmessage.txt
#
# Then use command below to use template.
# $git commit
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment