Hey. I gave a short at work about git-tfs. git-tfs is the two-way bridge between TFS (Team Foundation Server) and git. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.

A common use of it is to transfer a repo from TFS to git, but it’s also possible to use it and get some benefits as an individual on a team that hasn’t transferred yet. You can use git locally and still work with a TFS server. I think this is superior for a number of reasons. You can use better merge tool, you use branching locallyand you can fetch changes from the server without potentially trashing your local work.

In this talk I discuss that usecase, and also introduce some the basic concepts. The audio was recorded, and it’s about a 15 minute listen.





I talk about a “cool feature”, that lets you associate shelvesets with a work item. This is was a niche feature, but something that happened to be really important to our workflow. It’s also something I contributed to ‘git-ts’ myself.

I go on a bit of a tangent about “magic branches”. I think it would have been faster if I’d just said, “tfs branches appear in git as remote branches”. You’ll see when I get there.

You also can’t see (because it’s just audio) what command I use, so here they are:

Cloning

Clone everything

git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection

Or just clone a project

git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project

Or, if you’re impatient and only want to work from the last changeset

git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project

Or, if you’re slightly less impatient and want a specific changeset. (This is a great choice to balance time to clone and have a decent amount of history)

git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project -c=145

Fetching

git tfs fetch

Shelving

git tfs shelve MyShelvesetName

Checking in

Using a series of check-ins, one for each of your commits

git tfs rcheckin

or squashing your commits into a single TFS checkin:

git tfs checkin

Magic strings to put in a commit in order to resolve work items

git-tfs-work-item: <id>

git-tfs-work-item: <id> <action>