Skip to content

Instantly share code, notes, and snippets.

@ben-mohrbacher
Created May 20, 2024 14:47
Show Gist options
  • Save ben-mohrbacher/f79b74ca15d241b45495861423a258d4 to your computer and use it in GitHub Desktop.
Save ben-mohrbacher/f79b74ca15d241b45495861423a258d4 to your computer and use it in GitHub Desktop.
A git commit message template
<your-ticket-prefix>
# Subject Line
# ======================================================================
#
# One line less than 72 characters in length. Generally focused on the
# "What" rather than the "Why".
#
# Format <tag>: <message>
#
# `tag`: can be either a defined list of tags like "Add", "Remove",
# etc or can be the ticket/merge request ID.
# `message`: Should Be Written In Title Case
#
Why This Change Is Necessary
========================================================================
#
# This is the most important section of your commit message. Every
# commit tells a story. Some are short stories and some are novels.
# Although not a rule, a frequently helpful prompt if you're stuck on
# this is:
#
# > What was the problem you were trying to solve by changing the code
# > in the way you did?
#
# \/\/\/\/\/\/\/\/ Leave A Blank Line Below This Comment \/\/\/\/\/\/\/
What These Changes Do To Address the Issue
========================================================================
#
# This is the section that will tell others (or yourself in 6 months)
# your rationale for changing the code in the way you did. Feel free to
# add `**Note:**`, code-fencing, or any other markdown here. The PR
# will render it as HTML and at the same time, the commit message will
# still be very readable even as plain text.
#
# \/\/\/\/\/\/\/\/ Leave A Blank Line Below This Comment \/\/\/\/\/\/\/
# Caveats
# ------------------------------------------------------------------------
#
# This subsection explains exceptions to the code that you changed.
#
# Example:
#
# > Although we made this change in this way, it will not work in
# > sandbox without additional work to the Foobar class to retriculate
# > the splines.
#
# This subsection is not generally needed.
#
# \/\/\/\/\/\/\/\/ Leave A Blank Line Below This Comment \/\/\/\/\/\/\/
Side Effects Caused By This Change
========================================================================
#
# This is the second most important section of your commit message
# (after "Why"). It should always be included to show that you gave
# thought to the possible ramifications of your change.
#
# \/\/\/\/\/\/\/\/ Leave A Blank Line Below This Comment \/\/\/\/\/\/\/
None expected.
# Screenshots
# ========================================================================
# #
# # Uncomment and add screenshots of changes to the UI if appropriate,
# # otherwise ignore this section.
# #
# # \/\/\/\/\/\/\/\/ Leave A Blank Line Below This Comment \/\/\/\/\/\/\/
------------------------------------------------------------------------
**Relevant Links:**
* [Ticket Link][1]
# * [Doc with Specifications][2]
# * [Slack Conversation][3]
# **Tags:**
#
# * [wip]
# * [dont-merge]
# * [changelog]
# * [breaking-change]
# * [skip-ci]
# **Actions:**
#
# * Closes 35
------------------------------------------------------------------------
# Branch: <branch_name>
# Change-Id: 1234567890
# Co-authored-by: Diana Prince <ww@lassooftruth.com>
# Requested-reviewers: @myorg/some-team,@someonesusername
# Reviewed-by: Tyrion Lannister <tyrion@ipaymydebts.me>
# Signed-off-by: Sarah Connor <sconnor@theresistance.net>
[1]: https://<your-jira-url>/browse/<your-ticket-prefix>
# [2]: https://docs.google.com/documents/docid
# [3]: https://slack.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment