在TFS或Visual Studio Online中连接到git存储库 [英] Connect to git repository in TFS or Visual Studio Online

查看:276
本文介绍了在TFS或Visual Studio Online中连接到git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在团队基础服务中创建了一个git存储库,并且我想连接到它,但我不知道它的URL并且恼人地找不到它。



我创建了我的本地仓库,并且提供了我的初始仓库



现在我想知道我应该设置什么远程位置。我在基础服务网站上为我的repo myproject.mysubproject命名。



我试过 https://mysubdomain.visualstudio.com/myproject.mysubproject https://mysubdomain.visualstudio.com/myproject.mysubproject.git ,但是对于两个都没有雪茄,而且我差不多现在的想法。有人知道我可以在哪里找到回购站点吗?

编辑:作为一个方面说明:我从视觉工作室不使用 ,我也不希望为这个项目(但我会为其他项目)

解决方案

如果您转到Web UI,在代码中心下,如果它是空的回购,克隆网址将在那里。如果它不是空的,右边会有一个图标(双重纸图标),它会随克隆网址下拉。



该网址的格式为...



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



另外请注意,如果您浏览到该项目代码中心,则它与您的Web浏览器中的URL相同。

然而,在上一个版本中,我们添加了注释每个项目多次回购。对于初始回购,回购名称与项目相匹配,因此项目名称在URL中不需要。对于额外的回购,projectName可能是必需的:



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

但是,使用网络用户界面是获取网址的最简单方法。



一旦你有了这个url,你可以简单地运行git clone [url]



编辑:



对于身份验证,VSO最近添加了PAT令牌。您可以使用任何用户名和PAT标记作为密码。 请点击此处此功能不可用对于本地TFS还没有。

您也可以使用备用凭证:查看更多这里


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)

解决方案

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

这篇关于在TFS或Visual Studio Online中连接到git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆