Skip to content

Instantly share code, notes, and snippets.

@tarecord
Created January 14, 2021 20:14
Show Gist options
  • Save tarecord/6e8cb13136f8ebc263c4dcb07b2a30da to your computer and use it in GitHub Desktop.
Save tarecord/6e8cb13136f8ebc263c4dcb07b2a30da to your computer and use it in GitHub Desktop.
A template to help you write better commits
######## Subject Line (50 characters) ############
# - Use the imperative mood (imagine the words "This will")
# - Capitalize the first letter
# - Limit to 50 characters
# - Do not end the subject line with a period
######## The Body (72 characters per line) #############################
# - Add line breaks so each line is a maximum of 72 characters
# - Explain the thinking behind the commit
# - Do not use Markdown
######## Issue or Ticket Reference ########
# - The last line should reference the issue or ticket
@tarecord
Copy link
Author

Add this template to your git config:

  • Create a plain text file (I use ~/.git/.commit_template) and copy over the template
  • Add the template to your git config git config --global commit.template /path/to/.commit_template

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