Skip to main content

Focused commits πŸ”

What was the last message you provided when committing changes into version control? Was it along the lines of “fixes”, “wip”, or “stuff”? Then you might want to reconsider your commit strategy.

A magnifying glass focusing on one idea.

There are several reasons why people write short, unhelpful commit messages.

It may come down to plain laziness. Sometimes you cannot muster the energy to properly describe your changes. If this happens once or twice, then it is no big deal. If it happens regularly, I would encourage you to take your own work more seriously. Not to mention respecting your peers who need to understand the changes you’ve made.

The resistance against writing the commit message may also come from not really having a clear picture of what you have changed.1 If this is the case, it probably was too long since you last committed! If you commit after each task or “to do” is done, writing a good one-sentence message becomes a no-brainer.

A related symptom of committing too much is the urge to use the word “and”. As in, “fixed X and implemented Y”. Those are two unrelated changes lumped together for no good reason.

I would encourage you to practice making focused, intentional changes. Having a to do list next to you can help. Then you can scribble down any ideas that would take focus from your current task. You can focus on the current task without fear of forgetting that other thing you just thought of.

Making many small, focused commits also reduces the risk of having good changes that you want to keep getting mixed up with changes that turned out to be bad. The more often you are in a clean, committed state, the more you can allow yourself to try taking uncertain bets.

It is quite similar to David Allen’s expression “mind like water”.

A mental and emotional state in which your head is clear, able to create and respond freely, unencumbered with distractions and split focus.

While that may sound overly philosophical, I really think there is great power in taking small, focused steps. Not only does it give a kind of peace of mind, it also exercises your ability to reason about and distinguish between things that may look related but which really are separate. And that is a very important skill in software design and architecture.2

How small commits can you make?


  1. I would say that not knowing what commit message to write is a case of if you can’t explain it, you don’t understand it↩︎

  2. For example, detecting seemingly related things but which are not essential is key to finding things which will not be harder tomorrow↩︎