Connect to git repository in TFS or Visual Studio Online

后端 未结 2 1690
刺人心
刺人心 2020-12-14 16:15

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

相关标签:
2条回答
  • 2020-12-14 17:05

    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

    0 讨论(0)
  • 2020-12-14 17:13

    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

    0 讨论(0)
提交回复
热议问题