Happiness is…

…being able to use Git even when you thought you we’re stuck forever with Team Foundation Server at work. All thanks to Git-Tfs, a bridge between, yep you guessed it, Git and TFS! I’d already been using Git locally for code I was working on by myself and pushing my changes to a mapped drive that gets backed up every night but it was pretty awkward in terms of interacting with TFS and well, there isn’t really a solution when it comes to fetching other people’s changes. But now there is and I’m a very happy developer. Having experienced some considerable pain with the source control aspect of TFS recently I began to wish for something a little less problematic. Binning it altogether would be nice but probably unrealistic. Thankfully, Git-Tfs means I no longer have to care so much.

It’s easy to setup. Once downloaded and unzipped, you add the location to your PATH environment variable, open up git-bash and perform a clone of your TFS repository:

git-tfs clone "http://teamfound:8080/tfs/<your tfs collection name>" $/<your project name>

This creates a copy of the latest build with all the project history (which can take a while depending on project size). At that point you’re good to go with your usual local repository git workflow such as branching and merging etc. When it comes time to get the changes back into TFS you can either do a checkin with a message as you would normally:

git-tfs checkin -m "some message"

or

git-tfs checkin checkintool

which brings up the usual TFS check-in dialog. And the part that fell down for me with my previous method – grabbing other people’s changes – is now easily achieved simply with:

git-tfs pull

That’s just about the gist of it. I can only describe this tool as a god-send so I hope it continues to get updates and improvements. It’s definitely worth looking at if you’re in a similar position where you’d rather touch TFS as little as possible and, well, if you’ve never used Git then maybe this will give you the excuse you need to start.

Happiness is…