Write Good Commit Messages

It doesn’t take long and you never know when it will pay massive dividends.

Assumed audience: Software developers.

Write good commit messages. Yes, even when you’re working on a solo project or one where you work with just one or two other people. Your memory isn’t as good as you think it is (almost no one’s is!) and you’ll be glad you wrote it down. Tonight’s example for me was this commit on True Myth.

I implemented that particular change back in April, just five months ago. I remembered the broad strokes of the changes, but not every bit of the details or the underlying motivation — and I needed to remember those details to reason well about the context of a different change I am thinking about making. I am so glad I wrote down a good, thorough, careful commit message.

I have sometimes written detailed messages I did not end up needing (yet!) but I have never regretted it, because I don’t know when writing whether I will need it, and if I do, I cannot go back in time to have written it. Better to spend a little extra time writing down something I may not end up needing than to rush past that opportunity and lose it forever.