I experiment a lot before I choose an implementation I like. I am sure I am not alone in making a few (or many) false starts, and yet feeling sick at the thought of deleting any code. What if one of those paths I started down was the right one? This loss aversion often leads to working trees of non-working code, and
git stash-es that I will never revisit. If I stop myself from going too far down yet another road without an end in sight, attempts to clean up my working directory often stall miserably at the end of a
git checkout .:
1 2 3 4 5 6 7 8 9
Once upon a time, I would click my way through
rm. A small improvement in
rm efficiency came when I discovered I could
rm more than one file at a time (don’t judge me, I am new at this). Still, the biggest break-through came when a coworker, perhaps observing my struggles, pointed me to git-cheatsheet — a interactive visual tool to display the relevant commands for each stage of my git workflow.
Git clean is a force to be reckoned with, and not just because it doesn’t do anything unless you force it.
1 2 3 4 5 6
1 2 3 4 5 6
Now I can be as crufty as I want to be in my working tree, because
git will be there to clean up the mess.