Skip to content
ivan-danilov edited this page Aug 4, 2011 · 34 revisions

git-tfs is a two-way bridge between TFS and git, similar to git-svn. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.

Get git-tfs

Either download a binary, or build from source:

git clone git://github.com/spraints/git-tfs.git
cd git-tfs
msbuild GitTfs.sln
set PATH=%PATH%;%cd%\GitTfs\bin\Debug

The last step adds git-tfs.exe to your path. If you download a package, you'll need to complete this step, too.

Use git-tfs

git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project
# wait for a while, or, if you're impatient:
git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project
cd some_project
git log # shows your TF history, unless you did quick-clone
tf history # error: no workspace
# do work, just using git
git tfs fetch # gets latest from TF to the branch tfs/default
git tfs shelve MY_AWESOME_CHANGES

git-tfs is designed to work outside of any existing TFS workspaces.

Available commands / options

This is the complete list of commands in the master branch on github.

Repository setup

Pull from TFS

Push to TFS

Other

More information

Check out the README.

If you're migrating a TFS server from 2008 or 2005 to 2010, you might want to Specify Alternate TFS URLs.

If you have questions or suggestions about how we could improve git-tfs you could go to google group.

Example of setting up central git repository that tracks TFS automatically.

Clone this wiki locally