Git Based Workflow

Years ago, I read Joe Maller’s web focused git workflow article. I thought it very interesting, and was actually my catalyst to start playing around with Git. And while the wonderful world of Git started to open to me, I never actually implemented it for my blog. I tried a few things at the time, but it felt far more clunky that useful.

Fast forward a bit and I’ve now been using Git as a standard part of my toolset at work for a couple of years now. Nothing too fancy, but I feel much more comfortable with the general workflow of multiple branches, automating actions with hooks, multiple clones, remotes, etc. So, once I got my — seemingly annual — clean-up-my-site bug this year, one of the things I implemented was something similar to what Joe had outlined.

Not only has this workflow simplified the deploy process for me, especially as I have multiple devices on which I hack my site, but it saved me from near “disaster” last weekend. I was mucking around on my server (why oh why do I still do that?) and rmed my production web root rather than a temp copy I had in /tmp/. But, no biggie. In just a matter of seconds I had my site back online with a simple git clone and build. There were a few things I hadn’t included in my repo, most notably the little magnifying glass image in my search button; easy enough to replace. A nice lesson learned on a non-critical system.

And on that note, happy Backup Awareness Month!