Git Commit Messages

Discussions center on the importance, best practices, and debates around writing effective Git commit messages, emphasizing whether they should explain 'why' changes were made versus just 'what' changed, with examples of good and bad messages.

➡️ Stable 0.7x Open Source
4,552
Comments
19
Years Active
5
Top Authors
#8786
Topic ID

Activity Over Time

2008
3
2009
14
2010
38
2011
104
2012
129
2013
91
2014
113
2015
250
2016
163
2017
190
2018
205
2019
451
2020
401
2021
287
2022
503
2023
415
2024
563
2025
590
2026
42

Keywords

e.g youtube.com cbea.m WIP AI descriptions.html gitmoji.dev stackoverflow.com response.text github.com commit messages git message diff git commit fixes repo code fix

Sample Comments

ionforce Jun 23, 2015 View on HN

Because commit messages are important.

rcxdude May 21, 2024 View on HN

Counter-anecdata: I read git history extremely frequently, across a variety of projects. Useless commit messages suck.

mhluongo May 10, 2024 View on HN

The "why" should be in the commit message. That's what it's for

singpolyma3 Sep 28, 2025 View on HN

Commit messages are the developer docs for a change yes

joshdick Apr 1, 2016 View on HN

Write better commit messages. Garbage in, garbage out.

jmercouris Aug 1, 2025 View on HN

Good commit logs or comments may tell you why

samspot Feb 20, 2014 View on HN

Motivation for us all to write good commit messages.

ronjouch Oct 18, 2019 View on HN

Related: Greg Ward - Documenting history, or How to write great commit messages: say what, not why. https://www.youtube.com/watch?v=Jb6ij4eRu6c#t=378

bazzargh Aug 30, 2024 View on HN

This is just polishing bad commit messages, it doesn't make them better.A commit message should tell you why the code changed, not summarize what changed. I can read a code change and see what it does, but I can only guess what caused that change to be made unless the message tells me what was in your head (unless it's a trivial commit like a typo fix)See eg https://cbea.m

olivierlacan Nov 26, 2014 View on HN

Because it doesn't put you in the right mindset.A commit message should be formatted like an email to your past self, or your future collaborators. It should have a very descriptive and concise title (the first line of the message) written in the present tense and after a line break you should (when necessary) write an email style explanation of the reasoning behind the commit.If you fixed something, is there context that should be useful for someone discovering this commit in a vacuu