A Git/TFS bridge, similar to git-svn
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.
. See the change history for details and download.
This project is no more actively maintained because we are no more users of TFS. Thus being very useful, git-tfs is not exempt of not supported use cases. If you encounter something missing or a problem, please contribute, we will be pleased to help you.
The fastest way to get an issue fixed is to submit a PR that fixes it.
The slowest way to get it fixed is to hope someone else will fix it.
To get a stable version:
choco install gittfsto install the Chocolatey package
To get a development version
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 :
You need .NET 4.6.2 and the 2012 or 2013 version of Team Explorer installed (or Visual Studio) depending on the version of TFS you want to target.
#lists the available commands git tfs help
#shows a summary of the usage of a given command git tfs help
# [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:
This is the complete list of commands in the master branch on github.
⚠ Read absolutely this if your TFVC repository use Checkin policies when check-in.
diagnostics (for git-tfs developers only) - since 0.9
( Great thanks to AppVeyor! )
#get the source code git clone git://github.com/git-tfs/git-tfs.git cd git-tfs\src
#building with Cake (in a powershell console). It will also run the unit tests ;) .\build.ps1
#help on the different targets .\build.ps1 -Target "Help"
Note: if the build fails to build some
GitTfs.Vs201xprojects, just unload in Visual Studio all the projects you are not interested in to be able to build and use your own version. You could also install, the Team Foundation Server Object Model for Tfs 2012 (chocolatey) and Tfs 2013 (chocolatey).
Contributions are always welcome. Thanks to all our contributors!
Especially, don't forget:
.\build.ps1 -Target "FormatCode"before committing (to keep code formatting consistent, and pull request easier to review)
git config core.autocrlf true)
.editorconfigshould take care of that).
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 We also have a mailing list.