Profile picture
, 7 tweets, 2 min read Read on Twitter
Most commit messages are next to useless because they focus on WHAT was done instead of WHY.

This is exactly the wrong thing to focus on.

You can always reconstruct what changes a commit contains, but it's near impossible to unearth the reason it was done.

(thread)
Think about the last time you `git blame`d something.

You were almost certainly thinking "WHY is this like this?", not "What is a one-line summary of what happened in this commit?".
Here's the antidote: use this commit template (stolen from @joeferris).

```
[one line-summary of changes]

Because:
- [relevant context]
- [why you decided to change things]
- [reason you're doing it now]

This commit:
- [does X]
- [does Y]
- [does Z]
```
Leading with the WHY has tremendous value.

First, it captures context that will be near impossible to recover later. Trust me, this stuff is gold.

Secondly, if you train yourself to ask why you're making every change, you'll tend to make better changes.
Give this template a try for a while.

The first time you see a commit message like the above instead of "refactor OrderWidget", you'll be a convert.
For more thoughts on this topic, and details on setting up a commit message template, check out this post.

thoughtbot.com/blog/better-co…
Also! Here are a few examples of this commit message template in action:

github.com/thoughtbot/upc…

github.com/thoughtbot/upc…

github.com/thoughtbot/upc…
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Ben Orenstein
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!