DEV Community

loading...

Why bother with "git hygiene"?

Jonathan Hall
The Tiny DevOps Guy ⋄ I help small teams get the most out of DevOps
Originally published at jhall.io on ・1 min read

I’m a big fan of meaningful commit messages.

commit ef4d5ce5b6f13a3cc07f8941449bcaf445111cbf
Author: Jonathan Hall <flimzy@flimzy.com>
Date: Thu Feb 11 10:35:34 2021 +0100

    bugfix

Enter fullscreen mode Exit fullscreen mode

just doesn’t cut it.

I’m also a big fan of git rebase instead of git merge, fixup and ammend, and a whole host of other git tricks to keep my git history pristine and readable.

But why?

I rarely find myself doing git archeaology, so why fuss with all this?

— Maybe you. Probably someone you work with.

My response:

I rarely find myself in an automobile accident, so why bother wearing a seat belt?

When you do need it, a clean git history, like a seatbelt, is a lifesaver (although perhaps less literally).

Discussion (0)