Best Practices

How to Write the Best Git Commit Message
Run git log on any project that’s more than a year old and you’ll find the truth about a team. Half the messages say “fix”, “update”, “wip”, “asdf”, or my personal favourite — “stuff”. And then one day production breaks, you run git blame on the offending line, and the commit that introduced it just says “minor changes”. Cool. Very helpful. Thanks, past me. I’ve been writing code for over a decade and I’ll be honest: for the first few years my commit messages were garbage. It wasn’t until I had to debug someone else’s six-month-old code (and then realised the someone else was me) that the penny dropped. A diff tells you what changed. Only the commit message can tell you why. That’s the whole game.