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.

https://t.co/8e9p3x0zb0
Also! Here are a few examples of this commit message template in action:

https://t.co/KrOvHJPMXg

https://t.co/rnWpApDrTx

https://t.co/R7tAV3b8rx

More from Tech

THREAD: How is it possible to train a well-performing, advanced Computer Vision model 𝗼𝗻 𝘁𝗵𝗲 𝗖𝗣𝗨? 🤔

At the heart of this lies the most important technique in modern deep learning - transfer learning.

Let's analyze how it


2/ For starters, let's look at what a neural network (NN for short) does.

An NN is like a stack of pancakes, with computation flowing up when we make predictions.

How does it all work?


3/ We show an image to our model.

An image is a collection of pixels. Each pixel is just a bunch of numbers describing its color.

Here is what it might look like for a black and white image


4/ The picture goes into the layer at the bottom.

Each layer performs computation on the image, transforming it and passing it upwards.


5/ By the time the image reaches the uppermost layer, it has been transformed to the point that it now consists of two numbers only.

The outputs of a layer are called activations, and the outputs of the last layer have a special meaning... they are the predictions!

You May Also Like