Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Microsoft now has support for Git repositories on their Team Foundation Service. I have an account on Team Foundation Service, and I'd like to push my existing Git repository to a project there.

Whenever I try to do searches, I keep finding things like TFS-GIT, or GIT-TF. I'm pretty sure I don't want those, as I think those change to the Team Foundation Server model for code repositories, and that's not what I want.

Specifically, I have an existing Git repository that I want to push to TFService.

like image 432
McKay Avatar asked Feb 28 '13 06:02

McKay


People also ask

Does Team Foundation server use Git?

Git in Visual Studio, Azure DevOps Services, and TFS is standard Git. You can use Visual Studio with third-party Git services, and you can also use third-party Git clients with TFS.


2 Answers

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.

like image 153
McKay Avatar answered Oct 08 '22 00:10

McKay


"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/repo git remote add tfs url://tfs/git/repo git 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

like image 45
VonC Avatar answered Oct 08 '22 01:10

VonC