Skip to content

Instantly share code, notes, and snippets.

@TheLandolorien
Last active May 24, 2022 21:14
Show Gist options
  • Save TheLandolorien/78b53b2ba5182727866c35f11ec4c659 to your computer and use it in GitHub Desktop.
Save TheLandolorien/78b53b2ba5182727866c35f11ec4c659 to your computer and use it in GitHub Desktop.
A Git Commit Message Template to Guide Great, Consistent Messages
# <TYPE>: (If applied, this commit will...) <SUBJECT> (Max 50 char)
# Concisely describe the change
# Include any plugin-required text (e.g. Jira issue)
# |<---- Using a Maximum Of 50 Characters ---->|
# Provide additional explanation about the change (e.g. why?)
# |<---- Using a Wrap Maximum Of 72 Characters ---->|
# --- COMMIT END ---
#
# <TYPE> can be
# ✨ feat (new feature)
# 🐛 fix (bug fix)
# ♻️ refact (refactoring production code)
# 🎨 style (formatting, missing semi colons, etc; no code change)
# 📝 docs (changes to documentation)
# 🧪 test (adding or refactoring tests; no production code change)
# 🧹 chore (updating grunt tasks etc; no production code change)
#
# Based on adeekshith's commit message template
# https://gist.github.com/adeekshith/cd4c95a064977cdc6c50 (Licence CC)
#
# Emoji selection based on the gitmoji guide
# https://gitmoji.dev
#
# --------------------
#
# Remember to
# - Separate subject line from body with a blank line
# - Limit the subject line to 50 chars
# - Capitalize the subject line
# - Not end the subject line with a period
# - Use the imperative mood in the subject line
# - Wrap the body at 72 chars
# - Use the body to explain what and why instead how
#
# Based on Chris Beam's 7 rules of a great Git commit message
# https://chris.beams.io/posts/git-commit/#seven-rules (Licence CC)
#
# --------------------
#
# For the most up-to-date version of this template, visit:
# https://gist.github.com/TheLandolorien/78b53b2ba5182727866c35f11ec4c659
@TheLandolorien
Copy link
Author

Setup

  1. Download this file to your local machine.
    1. If using Windows, save as a filename without a leading period (.)
  2. Run the following git config command where <PATH/TO/FILE> is the path to where you downloaded the file.
    git config --global commit.template <PATH/TO/FILE>/.gitmessage

Sources

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