From aae37cb9cc41b73175541040c4ef96f352f771c6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 9 Apr 2025 00:03:41 +0100 Subject: [PATCH] Add daily email for 04/04/25 --- source/_daily_emails/2025-04-04.md | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/_daily_emails/2025-04-04.md diff --git a/source/_daily_emails/2025-04-04.md b/source/_daily_emails/2025-04-04.md new file mode 100644 index 000000000..ab2c0a987 --- /dev/null +++ b/source/_daily_emails/2025-04-04.md @@ -0,0 +1,38 @@ +--- +title: Writing good commit messages +date: 2025-04-04 +permalink: daily/2025/04/04/good +tags: + - software-development + - git +cta: ~ +snippet: | + What is a good commit message? How is it structured and what information should it contain? +--- + +There are many good resources and interesting articles online about how to write good messages when committing changes to a Git repository. + +The post I often refer to is [How to Write a Git Commit Message][0] by Chris Beams. + +In his post, he explains why good commit messages matter and gives these seven rules: + +> - Separate the subject from body with a blank line. +> - Limit the subject line to 50 characters. +> - Capitalize the subject line. +> - Do not end the subject line with a period. +> - Use the imperative mood in the subject line. +> - Wrap the body at 72 characters. +> - Use the body to explain what and why vs. how. + +I'd recommend reading the article to get the full context. + +Rules two and six suggest lengths for the subject line and body which is another reason [why I rarely use `-m`][1] when committing changes. + +Whilst you can create multi-line commit messages on the command line, by opening it in my preferred editor (Neovim for me), I can see where the lines should end and be warned if I exceed them. + +I can even include Chris' rules in my commit message template so I see them whenever I'm about to commit something. + +This additional feedback helps me create my commit messages how I intend. + +[0]: https://cbea.ms/git-commit +[1]: {{site.url}}/daily/2025/04/02/commit