Skip to content

Instantly share code, notes, and snippets.

@MaxwellBo
Forked from adeekshith/.git-commit-template.txt
Last active July 25, 2016 05:03
Show Gist options
  • Save MaxwellBo/440f26970207a0fd6e69 to your computer and use it in GitHub Desktop.
Save MaxwellBo/440f26970207a0fd6e69 to your computer and use it in GitHub Desktop.
A Git commit template to make it easy to enforce a good and uniform commit message style across teams.
# |<--- ^ <emoji>? <type>: <subject> ^ --->|
# |<--- v Explain why this change is being made v --->|
# |<--- v Provide links to tickets, issues or other resources v --->|
# --- COMMIT END ---
# Type can be
# feat (new feature)
# fix (bug fix)
# refactor (refactoring production code)
# style (formatting, missing semi colons, etc; no code change)
# docs (changes to documentation)
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)
# --------------------
# Remember to
# Capitalize the subject line
# Use the imperative mood in the subject line
# Do not end the subject line with a period
# Separate subject from body with a blank line
# Use the body to explain what and why vs. how
# Can use multiple lines with "-" for bullet points in body
# --------------------
# Emoji can be
# :new: when adding a feature
# :bug: when fixing a bug
# :apple: when fixing something on Mac OS
# :penguin: when fixing something on Linux
# :checkered_flag: when fixing something on Windows
# :lock: when dealing with security
# :racehorse: when improving performance
# :non-potable_water: when plugging memory leaks
# :haircut: when refactoring
# :x: when removing code or files
# :art: when improving the format/structure of the code
# :book: when writing docs
# :white_check_mark: when adding tests
# :shirt: when removing linter warnings
# :traffic_light: when fixing the CI build
# :arrow_up: when upgrading dependencies
# :arrow_down: when downgrading dependencies
# --------------------
@MaxwellBo
Copy link
Author

MaxwellBo commented Mar 12, 2016

To apply the template,
Save the above file to your local machine and use
git config --global commit.template <.git-commit-template.txt file path>
For example, if you saved it to your home folder, try:
git config --global commit.template ~/.git-commit-template.txt

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