Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to git repository in TFS or Visual Studio Online

I have created a git repository at team foundation services, and I want to connect to it, but I don't know its URL and annoyingly can't find it.

I created my local repo and dit my initial commit

Now I wonder what remote I should set. I named my repo myproject.mysubproject on the foundation services website.

I tried https://mysubdomain.visualstudio.com/myproject.mysubproject and https://mysubdomain.visualstudio.com/myproject.mysubproject.git, but for both, no cigar, and I'm pretty much out of ideas now. Does anyone know where I will be able to find the repo?

Edit: As a side note: I'm not working from visual studio, nor do I want to for this project (but I will for other projects)

like image 700
Martijn Avatar asked May 30 '13 11:05

Martijn


People also ask

How do I connect to a TFS repository in Visual Studio?

Visual Studio 2017Select Add Server to connect to a project in Team Foundation Server. Enter the URL to your TFS server and select Add. Select a project from the list and select Connect.

Can we use Git with TFS?

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. To learn more, see Git and Azure Repos.

Should I use TFS or Git?

You should use Git for version control in your projects unless you have a specific need for centralized version control features in TFVC. In other words, if you have a very specific reason why you need to continue using TFVC, Microsoft would rather you didn't.


1 Answers

If you go to the web UI, under the "code" hub, if it's empty repo, the clone url will be there. If it's not empty there is an icon to the right (double paper icon) that will drop down with the clone url.

The url will be in the form ...

https://[youraccount].visualstudio.com/DefaultCollection/_git/[gitRepoName]

Also note that it's the same URL that's in your web browser if you browse to that projects code hub.

However, note in the last release, we added multiple repos per project. For the initial repo, the repo name matches the project so project name isn't required in the url. For additional repos, projectName may be required:

https://[youraccount].visualstudio.com/DefaultCollection/[projName]/_git/[gitRepoName]

But once again, using the web UI is the easiest way to get the url.

Once you have that url you can simply run git clone [url]

edit:

For authentication, VSO recently added PAT tokens. You can use any username and the PAT token as the password. See more here This is not available for on-prem TFS yet.

You can also use Alternate Credentials: see more here

like image 88
bryanmac Avatar answered Oct 14 '22 21:10

bryanmac