Skip to content

Instantly share code, notes, and snippets.

@barijaona
Last active January 2, 2021 10:31
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 barijaona/fdb2883de5cf92d6580f451949f8f9e7 to your computer and use it in GitHub Desktop.
Save barijaona/fdb2883de5cf92d6580f451949f8f9e7 to your computer and use it in GitHub Desktop.
Git commit template
# <subject> (Preferably 50 char or less)(Max 72 char)
# |<---- Preferably using up to 50 chars --->|< - - - - - - - - - >|
# (Optional) Explain why this change is being made
# |<---- Try To Wrap Each Line to a Maximum Of 72 Characters ----->|
# (Optional) Provide links or keys to relevant tickets, articles or other resources
# Some issue trackers recognize the words close, fix, and resolve followed immediately by the issue number
# Example: Github issue #23
# (Optional) Include Co-authored-by for all contributors,
# so version control systems can connect teams
# Example: Co-authored-by: Name <name@example.com>
# --- COMMIT END ---
# Remember to
# - Capitalize the subject line
# - Use the imperative mood in the subject line
# - Do not end the subject line with a period
# - Separate subject from body with a blank line
# - Use the body to explain what and why vs. how
# - Can use multiple lines with "-" for bullet points in body
# --------------------
# It is suggested to use these imperative verbs to start the subject line:
# Fix = Fix an issue e.g. bug, typo, accident, misstatement.
# Add = Create a capability e.g. feature, test, dependency.
# Remove = Delete a capability e.g. feature, test, dependency.
# Start = Begin doing something; e.g. enable a toggle, feature flag, etc.
# Complete = End doing something; e.g. disable a toggle, feature flag, etc.
# Update = Increase the version of something e.g. a dependency.
# Bump = Mark a version
# Refactor = A change that MUST be just refactoring.
# Optimize = A change that MUST be just about performance, e.g. speed up code.
# Document = A change that MUST be only in the documentation, e.g. help files.
# Rephrase = A change that MUST be just textual, e.g. edit a comment, doc, etc.
# Reformat = A change that MUST be just format, e.g. indent line, trim space, etc.
# --------------------
# To install: git config --global commit.template PATH_TO_YOUR_COMMIT_TEMPLATE
# or, for a certain repository : git config --local commit.template PATH_TO_YOUR_COMMIT_TEMPLATE
# --------------------
# Updates and feedback: https://gist.github.com/barijaona/fdb2883de5cf92d6580f451949f8f9e7
# --------------------
# Legalese footnotes:
# You use it at your own risk.
# No rights retained by Barijaona Ramaholimihaso.
# ;-) It may be argued that this is, strictly speaking, not a template,
# as no part of it is actually used/included in the commit message. :)
# Credits:
# https://github.com/joelparkerhenderson/git_commit_template
# https://gist.github.com/adeekshith/cd4c95a064977cdc6c50
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment