How can I push my existing Git repository to Team Foundation Service How can I push my existing Git repository to Team Foundation Service git git

How can I push my existing Git repository to Team Foundation Service


Okay, I was apparently overcomplicating this. Here's what I did.

  1. Created a new project in TFService
  2. Connected to that project in Visual Studio
  3. Cloned that project in Visual Studio
  4. git pull c:\source\oldGitProject

That was it, it pulled all of the changes from the old location, and I could push that up to TFService easily.


"how do I push my existing git repository to TFService?"

Once you have declared a git repo on tfs.visualstudio.com (see below), add that git repo url to the remotes of your own local repo:

cd /path/to/local/repogit remote add tfs url://tfs/git/repogit push --mirror tfs

That will be enough to push the full history of your local repo back to that new upstream repo on TFS.

Again, the idea is to create a new empty repo on the upstream side (TFS), and to push your local repo to it.


(Original answer)

If I understand Scott Hanselman's blog post about it:

This Git support will require VS2012.2 (currently in preview) so you'll need to install that first, then get the VSIX. You'll be able to update both when VS2012.2 is released, and the Git VSIX will continue to update automatically via the VS Gallery.

It's a full source code provider for VS so you can use it to do most anything without leaving VS, or you can hang out at the command line and use it for a visual reminder as to the state of your repository.

For teams, you can go up to http://tfs.visualstudio.com and sign up for a account and get 5 users for free. You can choose either Git or Team Foundation Version Control (TFVC) as the source provider and use all the Team Foundation agile, scrum or other templates for your ALM tools

The registration process for a Git project is illustrated here, again pointing out that you need the “community technology preview” of the Git VSIX on top of a “community technology preview” of VS 2012 Update 2 (VS2012.2).

Git project in TFS


Some good answers above, but I found this even easier.

  • Create the local Git repository. (Or in my case, I converted my SVN repository to Git.)
  • Go to visualstudio.com and create the new project, specifying Git as the source control.
  • Click on the 'Code' menu option in the new project in VisualStudio.com.
  • The screen will show the exact Git command to push an existing repository, including the URL for your unique repository. All you have to do is copy and paste that command into your Git command prompt.

    git clone <repository url>