git config --global user.name "Randy Rowland"
git config --global user.email [email protected]
git config --global user.signingkey E80A8931C1245241F2BE03D6F32E17D74D6DE172
git config --global commit.gpgsign true
Place the below file into a directory that will be hidden away like ~/.config/
and name it .git-commit-template.txt
. You will then have to run a git config
to enable it.
git config --global commit.template /home/$USER/.config/.git-commit-template.txt
To prevent git from using the template as the commit message if you allow empty commit message, you'll need to set this:
git config --global commit.cleanup strip
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other
# resources
# Example
# Resolves: issue #23
# --- COMMIT END ---
# Type can be
# Feat: (new feature)
# Fix: (bug fix)
# Docs: (changes to documentation)
# Style: (formatting, missing semi colons, etc; no code change)
# Refactor: (refactoring production code)
# Test: (adding missing tests, refactoring tests; no production
# code change)
# Chore: (updating grunt tasks etc; no production code change)
# Update: (updating APIs, frameworks, keys, etc)
# WIP: (Work In Progress, used when you need to commit but
# unit block is not complete)
# --------------------
# Remember to
# - Separate subject from body with a blank line
# - Limit the subject line to 50 characters
# - Capitalize the subject line
# - Do not end the subject line with a period
# - Use the imperative mood in the subject line
# - Wrap the body at 72 characters
# - Use the body to explain what and why vs. how
# - Can use multiple lines with "-" for bullet points in body
# --------------------
# For more information about this template, check out
# https://gist.github.com/adeekshith/cd4c95a064977cdc6c50
https://gist.github.com/adeekshith/cd4c95a064977cdc6c50 https://chris.beams.io/posts/git-commit/