团队基金会服务git push时致命 [英] Team Foundation Service Fatal when git push

查看:192
本文介绍了团队基金会服务git push时致命的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将源代码管理(git)添加到我的项目中。我还使用git 在 Team Foundation Service中创建了一个项目。 Team Foundation Service 中的项目连接到我的 Visual Studio 。我有启用备用凭证。参考 Ref1 参考2



当我运行时;

  git remote add origin https:// yourname。 visualstudio.com/DefaultCollection/_git/ProjectName 

然后:

  git push origin master 


' https: //yourname.visualstudio.com ':`


输入用户名后:

 'https://username@hotmail.com@yourname.visualstudio.com'的密码:

输入密码后:


致命: https://yourname.visualstudio.com/DefaultCollection/ ProjectName / info / refs
未找到:您是否在服务器上运行git update-server-info?




<

解决方案

你可以尝试一下这个解决方案,我怎么能让这个成功?克隆TFS Git仓库,并在其中添加源代码,而不是尝试在本地创建仓库,并尝试添加远程仓库。



git clone 会设置(有希望)正确的远程,并且应该让你推回你添加和提交的任何代码。






Johan Leino 指出在评论中改为 SourceTree + TFS服务+ HTTPS:登录失败


我设置了一个免费的TFS帐户来测试它,并且可以重现问题。

我也可以使用来自 http:// git-scm的Git标准安装来重现它TFS不能用于标准的Git。



然而,你可以通过允许'替代认证Credentials'。


  1. 在右上角点击您的用户名并选择'我的个人资料'

  2. 选择'凭据'标签<​​/ li>
  3. 点击'启用替代凭证'

  4. 点击次要用户名旁边的设置没有'@'字符的用户名

  5. 设置密码

4和5似乎是可选的,但无论如何我做到了。我这样做,我可以使用我的完整电子邮件作为用户名或我创建的替代用户名从TFS克隆。

似乎默认的TFS身份验证是某种仅适用于VS工具的自定义系统,只是启用这种替代身份验证就可以与其他系统一起工作(为什么是不是默认的,微软?)



I have added Source Control (git) to my project. I have also created a project at Team Foundation Service with git. The project at Team Foundation Service is connected to my Visual Studio. I have Enabled alternate credentials. References Ref1 and Ref 2

When i run;

git remote add origin https://yourname.visualstudio.com/DefaultCollection/_git/ProjectName

Then:

git push origin master

I get this:

Username for 'https://yourname.visualstudio.com':`

After i enter username:

Password for 'https://username@hotmail.com@yourname.visualstudio.com':

After i enter password:

fatal: https://yourname.visualstudio.com/DefaultCollection/ProjectName/info/refs not found: did you run git update-server-info on the server?

I can't seem to find a solution to this, how could i make this a success?

解决方案

You could try to clone the TFS Git repo, and add your source in it, rather than trying to create the repo locally, and trying to add a remote.

The git clone would setup the (hopefully) right remote, and should let you push back whatever code you would have added and committed.


Johan Leino points out in the comments to "SourceTree + TFS Service + HTTPS: Login failed"

I set up a free TFS account to test this and can reproduce the problem.
I can also reproduce it using the standard install of Git from http://git-scm.com - it appears that out of the box, TFS won't work with standard Git.

However you can make it work by allowing 'Alternative Authentication Credentials' in TFS.

  1. Click on your username in the top-right and select 'My Profile'
  2. Select the 'Credentials' tab
  3. Click 'Enable Alternative Credentials'
  4. Click 'Set' next to the secondary user name and pick a username without an '@' character
  5. Set a password

4 and 5 seem to be optional, but I did it anyway.
Once I did this, I could clone from TFS using either my full email as a user name or the alternative user name I'd created.

It seems like the default TFS authentication is some kind of custom system that only works with the VS tools, and just enabling this alternative authentication makes it work with other systems (why isn't this the default, Microsoft?)

这篇关于团队基金会服务git push时致命的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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