Skip to content
This repository

A Git/TFS bridge, similar to git-svn

Merge pull request #585 from pmiossec/correct_garbage_collect

Prevent a first GC when not needed
latest commit e5ac63baaf
Philippe Miossec pmiossec authored April 21, 2014
Octocat-spinner-32 .nuget Package up the build. December 20, 2012
Octocat-spinner-32 ChocolateyTemplates better description (?) November 24, 2013
Octocat-spinner-32 GitTfs.Vs2008 Retry on timeout March 13, 2014
Octocat-spinner-32 GitTfs.Vs2010 Retry on timeout March 13, 2014
Octocat-spinner-32 GitTfs.Vs2012 Merge pull request #530 from KindDragon/small-improvments March 14, 2014
Octocat-spinner-32 GitTfs.Vs2013 Merge pull request #530 from KindDragon/small-improvments March 14, 2014
Octocat-spinner-32 GitTfs.VsCommon Merge pull request #530 from KindDragon/small-improvments March 14, 2014
Octocat-spinner-32 GitTfs.VsFake Removed unused using directives February 06, 2014
Octocat-spinner-32 GitTfs Prevent a first GC when not needed April 19, 2014
Octocat-spinner-32 GitTfsBenchmarks Remove VS2012 Debug Configuration October 06, 2013
Octocat-spinner-32 GitTfsTest.Vs2010 Remove VS2012 Debug Configuration October 06, 2013
Octocat-spinner-32 GitTfsTest Skip fetching merged items without changes from TFS March 14, 2014
Octocat-spinner-32 doc Add #530 to release notes. March 14, 2014
Octocat-spinner-32 lib Don't convert line endings in commit messages. February 12, 2014
Octocat-spinner-32 packages Use GitTfsTasks November 17, 2013
Octocat-spinner-32 script Try to be more POSIX-y? February 11, 2014
Octocat-spinner-32 .editorconfig Add a file to set space settings of VisualStudio automatically March 08, 2013
Octocat-spinner-32 .gitattributes .gitattributes : diff as csharp for better diffs (get method name) May 19, 2013
Octocat-spinner-32 .gitignore Ignore some things November 20, 2013
Octocat-spinner-32 .gitmodules Fix (?) libgit2sharp git url. September 13, 2012
Octocat-spinner-32 .travis.yml Extract a script for the travis build, so I can test it locally more … March 27, 2013
Octocat-spinner-32 Auth.targets.example Use GitTfsTasks November 17, 2013
Octocat-spinner-32 CI.proj Fix the build. December 19, 2012
Octocat-spinner-32 CONTRIBUTING.md Ask for release notes with PRs. November 19, 2013
Octocat-spinner-32 CommonAssemblyInfo.cs Extracted version and common assembly attributes. October 05, 2010
Octocat-spinner-32 Gemfile Automated some of the release process. (h/t jeweler) October 05, 2010
Octocat-spinner-32 Gemfile.lock Upgraded albacore so I can still use rake to build. January 25, 2011
Octocat-spinner-32 GitTfs.sln Enable VS2013 client build in Debug|x86. October 09, 2013
Octocat-spinner-32 LICENSE Updated license. February 12, 2010
Octocat-spinner-32 NOTICE Update copyright notice November 14, 2012
Octocat-spinner-32 README.md Add missing reset-remote command in the list January 31, 2014
Octocat-spinner-32 Rakefile Make the version task advertise itself on rake -T. March 11, 2011
Octocat-spinner-32 Release.proj Add release notes in chocolatey package November 24, 2013
Octocat-spinner-32 Releasing.md Refactor, and drop the need to manually run the Chocolatey task. November 20, 2013
Octocat-spinner-32 TODO Added TODO note. October 05, 2010
Octocat-spinner-32 Version.cs v0.19.2 December 02, 2013
Octocat-spinner-32 autorake.rb Added a watchr-based autobuilder. October 26, 2009
Octocat-spinner-32 mono-git-tfs Rename mono git-tfs runner. January 30, 2012
Octocat-spinner-32 sample.html Moved content from css to text. February 03, 2010
Octocat-spinner-32 sample.txt Created a sample session. January 28, 2010
Octocat-spinner-32 test-git-tfs.sh Started adding a quick-clone command that doesn't pull in history. June 21, 2010
README.md

Introduction

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.19.2. 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 differents 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 2008, 2010 or 2012 version of Team Explorer installed.

Help

#lists the available commands
git tfs help

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

Cloning

# [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

Working

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

Checkin

# 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

You could find more interesting use cases on how to use git-tfs.

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

Manage TFS branches

Other

Building

Prerequisites

  • MSBuild (included in .NET 4)

And depending of the version of TFS you use :

Get the source code and build

#get the source code
git clone --recursive git://github.com/git-tfs/git-tfs.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 update

Contributing

Contributions are always welcome.

There are some simple guidelines.

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

Migrations

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.

Community

#git-tfs on FreeNode, and the mailing list

Build Status

Thanks to travis-ci and jetbrains (teamcity) for providing CI!

Something went wrong with that request. Please try again.