Skip to content

Instantly share code, notes, and snippets.

@jkereako
Forked from Linell/.git-commit-template.txt
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkereako/9198674157ea6bf7e9c9 to your computer and use it in GitHub Desktop.
Save jkereako/9198674157ea6bf7e9c9 to your computer and use it in GitHub Desktop.
A modified version of Sparkbox's Git commit template.
#<Type>: <subject>
#<body>
#-------------------------------------------------------------------------------
#<footer>
#-- Commit types
# - Add; a new file
# - Chore; files which are neither code nor documentation (i.e. .gitignore)
# - Delete; removed a file
# - Docs; all documentation files, including README and LICENSE
# - Feature; a new feature
# - Fix; a bug fix
# - Format; source code format changes (i.e indentation, missing brackets)
# - Refactor; refactoring production code
# - Test; changes related to tests
#-- Variable descriptions
# - <type> describes the change type.
# - <subject> ought to describe the change set in 1 line.
# - <body> ought to provide detail about changes made.
# - <footer> ought to contain references to issue tracking software or actions.
#-- Writing rules
# - The subject line ought to be 50 columns or fewer
# - Capitalize the first letter of <Type>
# - Follow Markdown syntax
# - Wrap all body and footer text to 80 columns or fewer.
#-- Further reading
# - https://github.com/sparkbox/how_to/tree/master/style/git
# - http://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#idp16385152
@jkereako
Copy link
Author

jkereako commented Mar 2, 2015

Description

This is an edited version of Linell Bonnette's .git-commit-template.txt.

Changes

  • Removed the variable <scope>. I don't know its purpose. As such, it probably means that I don't need it
  • Changed formatting and grammar. Replace "should" with "ought to" and separate each section with #--
  • Removed the guideline asking that statements be written in the imperative mood. It's more natural to write in the past tense.
  • Added suggestion to follow Markdown syntax. Markdown is concise and universally understood.

Usage

Copy and past this text as is into a text editor and save it in your home directory as .gitmessage.txt. Then, open your terminal and execute this command

git config --global commit.template ~/.gitmessage.txt

NOTE
Don't worry about the documentation in this template appearing in your commit messages because they are all commented-out. Leave the documentation in the commit template so that you always have it right in front of you each time you commit a change set.

Further reading

You'll see everyone and their mother link to A Note About Git Commit Messages, which is why I have it here. However, I think the entire post is pointless. It's some clown's opinion from 7 years ago. Time Pope doesn't seem stable, either. I wouldn't listen to him.

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