|
|
|
|
|
by ghevshoo
2622 days ago
|
|
> I have seen failed projects where the complete lack of commit sanity wasn't the cause, but a very clear sign, of what was wrong. Clean commit messages fall into the same area as “good git hygiene” for me. When I was consulting (mostly in the areas of DevOps and CI/CD), git hygiene was the very first thing of any new assignment I would take a close look at. I joined a project that one of the main contributing factors in its failure was poor git hygiene. The real killer was a mess of branches that everyone had direct push access to. One of their repositories which contained cfengine infrastructure code was branched per environment. The configuration drift between the branches was so great that the dev team decided it was easier to throw away the entire codebase and rebuild production from scratch. This is how I fell into training developers how to use git, because clean history is a very good indicator of the overall heath of the project. One of the things I taught myself and then started teaching others is “always keep the head of you branch in a clean working state”. I recognized the common development commit pattern “do a thing” and then immediately afterwards “fix the thing I just did”. Git never provided an easy way to squash/fixup those commits without popping up my editor, so I made my own little alias which others might also find useful:
https://gist.github.com/philbert/c13ca7220951970225196cbce92... |
|