version control

Stop letting .DS_Store slow you down

I have over 100 git repositories on my Mac, and for almost every one, I sometimes browse the directory structure in the Finder. Once I do that, I inevitably end up with a few pesky .DS_Store files that want to be added to my repo:

Pesky .DS_Store Files in Terminal during Git Status

.DS_Store files don't add anything of value to my code (they just tell Mac OS X about folder display and icons), so I always end up adding them to my own projects' .gitignore files. But when I'm working on other repositories (like Drupal, or a fork from GitHub) I don't want to add a .gitignore if none exists, or mess with the project's existing .gitignore. So what's a coder to do?

There are a couple good solutions:

Push your Git repositories to a central server, in a bare repository

GitHub is a great central repository silo for open source projects, and for private Git repositories for companies and organizations with enough cash to afford the features GitHub offers.

However, for many projects and developers, GitHub can be overkill. For my needs, I have many smaller private projects that I'd like to have hosted centrally, and backed up, but don't warrant BitBucket or GitHub accounts. Therefore, I've taken to creating bare repositories on one of my Linode servers, and pushing all my local branches and tags to these repos. That server is backed up nightly, so I know if I lose my local environment, as well as my Time Machine backup (a very unlikely occurrence, but still possible), I will have backed up and fully intact Git repos for all my projects.

I recommend you do something like the following (presuming you already have a Git repo on your local computer that you've been working with):

Prepping for Git on drupal.org - Need a Git client? Try Tower

A few weeks ago, I heard rumors of a new Git client for the Mac that was supposed to be even easier/prettier than my past favorite, GitX (specifically, brotherbard's fork of GitX). GitX is simple, and very usable, but just feels rough sometimes. But... it's free, so it is very nice in that way.

Tower for St. Louis Review
Yes, I often work on the server. "Do what I say, not what I do."

This new Git client is Tower, and it is awesome. I paid for two licenses for my two Macs, and I highly recommend it for other Mac users deeply invested in Git. The interface is simple, it has searchable commit logs, it lets you stage and unstage (and modify) changes and commits with efficiency and ease, and it is $50 well-spent. Check out the Tower demonstration video on YouTube.