Skip to content
A Git/TFS bridge, similar to git-svn
C# Other
Latest commit f32bd44 @spraints spraints Merge pull request #837 from pmiossec/tfs2015_nuget
Manage Tfs2015 assemblies with the new nuget packages released by Microsoft
Failed to load latest commit information.
.nuget Shell out to nuget and restore from multiple manifests
ChocolateyTemplates Update the description a little...
FunctionalTesting Little better build output....
GitTfs.Vs2010 Ignore file during the post build copy
GitTfs.Vs2012 Ignore file during the post build copy
GitTfs.Vs2013 Ignore file during the post build copy
GitTfs.Vs2015 Ignore file during the post build copy
GitTfs.VsCommon Gated check-in in batch could possibly give a build failed
GitTfs.VsFake refacto: use 'int' to handle changeset Ids
GitTfs Merge pull request #837 from pmiossec/tfs2015_nuget
GitTfsTest refacto: use 'int' to handle changeset Ids
doc Update release note
lib Removed libgit2sharp submodule
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 Add Vs2015 (and TFS2015) support
.gitmodules Removed libgit2sharp submodule
Auth.targets.example Use GitTfsTasks
CI.proj Included xunit.runners 1.9.2 nuget in GitTfsTest Fix link for running the unit tests
CommonAssemblyInfo.cs Update Copyright
Gemfile Automated some of the release process. (h/t jeweler)
Gemfile.lock Upgraded albacore so I can still use rake to build.
GitTfs.sln Test project also build in Release
LICENSE Updated license.
NOTICE Update copyright notice v0.23.0
Rakefile Make the version task advertise itself on rake -T.
Release.proj (Hope to) fix the released zip file adding GitTfs.Vs20xx sub folders Fix Releasing
Version.cs v0.23.0
appveyor.yml Copy GitTfs.Vs20xx in subfolders
autorake.rb Added a watchr-based autobuilder.
files_to_ignore_during_post_build_copy.txt Ignore file during the post build copy
mono-git-tfs Rename mono git-tfs runner. 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.23.0. 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:

  • Download a binary. Find it on the release page,
  • Using Chocolatey. If Chocolatey is already installed on your computer, run choco install gittfs to install the Chocolatey package
  • Build from source code. See §Building for more informations...

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

  • list-remote-branches: list tfs branches that can be cloned or initialized - since 0.17
  • clone: clone a tfs path/branch and its history in a git repository - since 0.9
  • quick-clone: clone a specific changeset of a tfs path/branch in a git repository - since 0.9
  • bootstrap: bootstrap an existing git-tfs repository cloned from an existing repository - since 0.11
  • init: initialize a git-tfs repository (without getting changesets) - since 0.9

Pull from TFS

  • clone: clone a tfs path/branch and its history in a git repository - since 0.9
  • fetch: get changesets from tfs and update the tfs remote - since 0.9
  • pull: get changesets from tfs, update the tfs remote and update your work - since 0.9
  • quick-clone: clone a specific changeset (without history) of a tfs path/branch in a git repository - since 0.9
  • unshelve: fetch a tfs shelvesets in your repository - since 0.11
  • shelve-list: list tfs shelvesets - since 0.12
  • labels: fetch tfs labels - since 0.17

Push to TFS

  • rcheckin: replicate your git commits as tfs changesets - since 0.12
  • checkin: checkin your git commits as one tfs changeset - since 0.10
  • checkintool: checkin in tfs using the tfs checkin dialog - since 0.10
  • shelve: create a shelveset from git commits - since 0.9

Manage TFS branches


  • info: get some informations about git-tfs and tfs
  • cleanup: clean some git-tfs internal objects - since 0.10
  • cleanup-workspaces: clean tfs workspaces created by git-tfs - since 0.10
  • help: get help on git-tfs commands - since 0.9
  • verify: verify the changesets fetched - since 0.11
  • autotag option - since 0.12
  • subtree: manage sparse tfs pathes with git-tfs - since 0.19
  • reset-remote: reset a tfs remote to a previous changeset to fetch again its history - since 0.19
  • checkout: checkout a commit by a changeset id - since 0.21
  • diagnostics (for git-tfs developers only) - since 0.9

  • config file


Continuous Integration Status

Teamcity build status & AppVeyor build status ( Great thanks to Teamcity Icon Jetbrains Teamcity and AppVeyor Icon AppVeyor! )


  • 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. Thanks to all our contributors!

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.


Drop in and chat in gitter We also have a mailing list.

Something went wrong with that request. Please try again.