Skip to content

Instantly share code, notes, and snippets.

@jordan-gillard
Last active January 15, 2025 20:16
Show Gist options
  • Save jordan-gillard/d7355790795195f37197fea41d3916e6 to your computer and use it in GitHub Desktop.
Save jordan-gillard/d7355790795195f37197fea41d3916e6 to your computer and use it in GitHub Desktop.
Git Commit Template
#------------Subject Line Length (50)------------#
#-----------------------Body Line Length (70)------------------------#
#---------------------------------TYPE-------------------------------#
# build: Changes affecting build system or external dependencies
# (example scopes: gulp, broccoli, npm)
# ci: Changes to our CI configuration files and scripts
# (example scopes: Travis, Circle, BrowserStack, SauceLabs)
# docs: Documentation only changes
# feat: A new feature
# fix: A bug fix
# perf: A code change that improves performance
# refactor: A code change that neither fixes a bug nor adds a feature
# style: Changes that do not affect the meaning of the code
# (white-space, formatting, missing semi-colons, etc)
# test: Adding missing tests or correcting existing tests
#-------------------------------FORMAT-------------------------------#
# <type>(<scope>): <subject>
# <BLANK LINE>
# <body>
# <BLANK LINE>
# <footer>
#-------------------------------SCOPE--------------------------------#
# may be provided to a commit’s type, to provide additional
# contextual information and is contained within parenthesis,
# e.g., feat(parser): add ability to parse arrays.
#-------------------------------FOOTER-------------------------------#
# The footer should contain any information about Breaking Changes
# and/or reference GitHub issues that this commit Closes.
# Breaking Changes should start with "BREAKING CHANGE:" with a
# space or two newlines. Rest of commit message is used for this.
# Footers other than BREAKING CHANGE: <description> may be provided
# and follow a convention similar to git trailer format, like:
# Fixes: ISSUE / COMMIT
# Helped-by: AUTHOR <EMAIL>
# Reference-to: ISSUE / COMMIT
# See-also: ISSUE / COMMIT
# Cc: AUTHOR <EMAIL>
# Reviewed-by: AUTHOR <EMAIL>
# Signed-off-by: AUTHOR <EMAIL>
@jordan-gillard
Copy link
Author

Set as your default commit template via

git config --global commit.template /path/to/.git-commit-template.txt

Or by adding the following lines to your .gitconfig file -

[commit]
    template = /path/to/.git-commit-template.txt

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