From 7ab0964083c7d2d902f6f5ae239e95d9c5f6e27b Mon Sep 17 00:00:00 2001 From: Marley Rae Date: Fri, 2 Feb 2024 20:36:40 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20commit=20message=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git/.gitconfig.symlink | 4 ++++ git/commit_template | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 git/commit_template diff --git a/git/.gitconfig.symlink b/git/.gitconfig.symlink index 41d8bbe..de783c6 100644 --- a/git/.gitconfig.symlink +++ b/git/.gitconfig.symlink @@ -1,3 +1,5 @@ +# vim:set ft=gitconfig : + [core] attributesFile = ~/dotfiles/git/.gitattributes excludesFile = ~/dotfiles/git/.gitignore @@ -21,6 +23,8 @@ [init] defaultBranch = main +[commit] + template = ~/dotfiles/git/commit_template [push] autoSetupRemote = true [rebase] diff --git a/git/commit_template b/git/commit_template new file mode 100644 index 0000000..0a70d01 --- /dev/null +++ b/git/commit_template @@ -0,0 +1,24 @@ +# Title: Summary, imperative, start upper case, don't end with a period +# No more than 50 chars. #### 50 chars is here: # + +# Remember blank line between title and body. + +# Body: Explain *what* and *why* (not *how*). +# Wrap at 72 chars. ################################## which is here: # + + +# At the end: Include Co-authored-by for all contributors. +# Include at least one empty line before it. Format: +# Co-authored-by: name +# +# How to Write a Git Commit Message: +# https://chris.beams.io/posts/git-commit/ +# +# 1. Separate subject from body with a blank line +# 2. Limit the subject line to 50 characters +# 3. Capitalize the subject line +# 4. Do not end the subject line with a period +# 5. Use the imperative mood in the subject line +# 6. Wrap the body at 72 characters +# 7. Use the body to explain what and why vs. how +