Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Git/TFS bridge, similar to git-svn
C# Other

Merge pull request #773 from ryanbnl/issue-771

Fix for issue #771: Fixed incorrect call to VersionControlServer.QueryMerges().
latest commit 4bb7466b9b
@spraints spraints authored
Failed to load latest commit information.
.nuget Update xunit.runners also
ChocolateyTemplates better description (?)
GitTfs.Vs2010 WrapperForWorkspace and WrapperForBranchObject could go in Wrappers.cs
GitTfs.Vs2012 Simplify a little more registry read for VS>=2012
GitTfs.Vs2013 Simplify a little more registry read for VS>=2012
GitTfs.VsCommon Whitespace fix (which also forces a rebuild ;))
GitTfs.VsFake Fix changesets returned by TfsHelperFake
GitTfs Merge pull request #747 from JaCoB1123/master
GitTfsBenchmarks Remove VS2012 Debug Configuration
GitTfsTest.Vs2010 Remove VS2012 Debug Configuration
GitTfsTest Add Stub for HasRemote
doc Improve labels command documentation
lib Update LibGit2Sharp to v0.21
packages/MSBuildGitTfsTasks Use GitTfsTasks
script remove /bin/sh option added
.editorconfig Add a file to set space settings of VisualStudio automatically
.gitattributes .gitattributes : diff as csharp for better diffs (get method name)
.gitignore Ignore some things
.gitmodules Fix (?) libgit2sharp git url.
Auth.targets.example Use GitTfsTasks
CI.proj Build "Any CPU" on travis. Fix link for running the unit tests
CommonAssemblyInfo.cs Extracted version and common assembly attributes.
Gemfile Automated some of the release process. (h/t jeweler)
Gemfile.lock Upgraded albacore so I can still use rake to build.
GitTfs.sln There can be only "Any CPU".
LICENSE Updated license.
NOTICE Update copyright notice Merge remote-tracking branch 'origin/master' into idempotent-releases
Rakefile Make the version task advertise itself on rake -T.
Release.proj Update the website repo so that we can update the website more than once Release notes go here
TODO Added TODO note.
Version.cs v0.21.1
autorake.rb Added a watchr-based autobuilder.
mono-git-tfs Rename mono git-tfs runner.
sample.html Moved content from css to text.
sample.txt Created a sample session. Started adding a quick-clone command that doesn't pull in history.


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

The most recent version is 0.21.1. See the change history for details.

If you're having problems, check out the troubleshooting page. And read how to report an issue, before doing so ;)

Get git-tfs

Three different ways to get git-tfs:

Whatever the way you get git-tfs, you should have git-tfs.exe in your path (and git, too).

Add the git-tfs folder path to your PATH. You could also set it temporary (the time of your current terminal session) using :

set PATH=%PATH%;%cd%\GitTfs\bin\Debug

Use git-tfs

You need .NET 4 and either the 2010, 2012 or 2013 version of Team Explorer installed (or Visual Studio).


#lists the available commands
git tfs help

#shows a summary of the usage of a given command
git tfs help <command>


# [optional] find a tfs repository path to clone :
git tfs list-remote-branches http://tfs:8080/tfs/DefaultCollection

# clone the whole repository (wait for a while...) :
git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project

# or, if you're impatient (and want to work from the last changeset) :
git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project

# or, if you're impatient (and want a specific changeset) :
git tfs quick-clone http://tfs:8080/tfs/DefaultCollection $/some_project -c=145


cd some_project
git log # shows your TFS history, unless you did quick-clone
tf history # error: no workspace ;)

# [do work, do work, just using git], then...
# gets latest from TFS to the branch tfs/default :
git tfs fetch


# report all the commits on TFS :
git tfs rcheckin

# or commit using the tfs checkin window
git tfs checkintool 

# or commit with a message
git tfs checkin -m "Did stuff"

# or shelve your changes :
git tfs shelve MY_AWESOME_CHANGES

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

Have a look to more detailed git-tfs use cases:

Available commands / options

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

Repository setup

Pull from TFS

Push to TFS

Manage TFS branches




  • MSBuild (included in .NET 4)

And depending of the version of TFS you use :

Get the source code and build

#get the source code (with submodules source code!)
git clone --recursive git://
cd git-tfs

#building with MSBuild (with the default configuration)
msbuild GitTfs.sln

#or building with MSBuild in debug
msbuild GitTfs.sln /p:Configuration=debug

#or building with MSBuild in release
msbuild GitTfs.sln /p:Configuration=release

#or with Rake (Ruby)
rake build:debug

Note : if the build fails because it can't find libgit2sharp dependency, update submodules with git submodule init followed by git submodule update


Contributions are always welcome.

There are some simple guidelines.

Especially, don't forget to set core.autocrlf to true. (git config core.autocrlf true)


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.


#git-tfs on FreeNode, and the mailing list

Thanks to jetbrains (teamcity) for providing CI!

Something went wrong with that request. Please try again.