"I'd feel utterly naked, anymore," if I were writing software without the
constant daily use of
git. When I finish writing some new thing or come to a point where I'm not 100% sure what to do next, I do
git commit -a. Certainly at the end or beginning of each and every day. "Time for lunch," the same. Even if what I've done is not yet "finished."
No one
(see below ...) will ever see that commit but me. Now I know that I can get back to
exactly this point.
And, every now and then when I realize that I have just screwed everything up
it's time for
git reset --hard and try again.
"Don't leave home without it."
Usually, this is purely
local development that will
never be "pushed" anywhere. But, if I am expected to push them to a shared repository, I will do my "lots of individual commits" and then use
git rebase to consolidate them into something a little more reasonable, reducing my "many commits" into just one that I can then "push." I also use branches to bookend the various little units of work, then merge them in.
My computer's background backup process (Apple's "Time Machine") sweeps through at least once an hour as it always does, and it captures the repository too.
I have also learned to be very
descriptive and
talkative in my "commit notes." (As are the comments in my code.) Partly because I have learned to have no confidence that I will actually remember on my own. I keep a "Captain's Log" anyway – consisting of a loose-leaf notebook and a few number-two pencils(!). Because I know that I
won't exactly remember the questions that I had or the things that I did, very long after having done them. I have years of such notebooks, and they're interesting reading – now being the writings of a complete stranger.
Things that were "completely clear at the time" can simply be forgotten in their entirety. So, anytime I'm managing a project for a client, I also insist on this.
"No, no ... go right now and write it down while it's fresh on your mind! Just write it off the top of your head without thinking about it too much and then hit 'Save.' Don't go back and edit it – just leave it alone." Sometimes, in meetings that occur months later, we go back and read the "Captain's Log" and there's the answer we were looking for. It's pretty amazing.