26

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)

bryanmac
  • 38,941
  • 11
  • 91
  • 99
Martijn
  • 11,964
  • 12
  • 50
  • 96
  • If you are going to connect to the TFS git repo through something other than Visual Studio then you must enable "basic authentication" in your VS online profile. http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-45-92-2013-03-Git_2D00_Command_2D00_Prompt/4722.GitSettingsTFSProfileAltCreds.png – Robino Jan 30 '14 at 15:06
  • 1
    @Robino the link is dead – Prashant Cholachagudda Mar 30 '17 at 05:42
  • @PrashantC -- you can follow the method here instead https://www.visualstudio.com/en-us/docs/integrate/get-started/auth/overview – Robino Mar 30 '17 at 10:27

2 Answers2

41

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

bryanmac
  • 38,941
  • 11
  • 91
  • 99
  • 1
    thanks for the input. we're discussing how to make it more discoverable (perhaps @ end of creation wizard??) – bryanmac May 30 '13 at 11:57
  • 1
    After all, the single most important thing to know about a repo is its url. – Martijn May 30 '13 at 12:17
  • How do I get to the "code hub"? Should I see a "code" tab on https://[youraccount].visualstudio.com/DefaultCollection? Because I don't. – Henrik Heimbuerger Aug 13 '13 at 09:34
  • Once you create a project and then navigate to the project the hubs are home, code, work, build, test – bryanmac Aug 14 '13 at 02:22
  • 1
    Does visualstudio.com support SSH connection to a repo instead of HTTPS? – kmehta Aug 29 '14 at 16:45
  • 2
    @kmehta - ssh is on the backlog shorlist – bryanmac Apr 26 '15 at 21:44
  • 3
    Is this still valid in 2016? I went to the Code page of an existing project and see nothing resembling a “double paper icon”, a “drop down”, nor anything with a UTL remotely like what you posted. Can you post a screen shot of what I am supposed to be looking for? – Dour High Arch Oct 31 '16 at 17:53
  • I didn't see the 'double paper icon' and the reason was when I created the project I didn't select a GIT template. I accidentally used the Microsoft Project template. – Tom McDonald Nov 02 '16 at 18:23
  • @kmehta [yes](https://www.visualstudio.com/en-us/docs/git/use-ssh-keys-to-authenticate). Need to use `ssh://` url for that. – dashesy Dec 21 '16 at 20:21
  • Why is it so hard to find a simple URL? It's called passive aggressive UI design. MS wants to keep you in their ecosystem by making alternatives methods less intuitive. This design strategy has backfired as MS found developers moved over to GitHub. This design strategy has cost them $7 billion dollars. – ATL_DEV Aug 06 '18 at 16:20
4

This has been slightly tweaked in the newer versions of Visual Studio Online. Now go to your project, go to "Code", and then (assuming you've already set up a project) there will be a "Clone" button on the far right, hitting that will bring a little popup with the clone url (which is the git url). VSO Image

Jason Masters
  • 160
  • 2
  • 8