简体   繁体   English

使用TFS Git存储库从外部工具进行身份验证

[英]Authentication from external tools with TFS Git repository

We've been using TFS (on premise) for version control for a long time and we recently moved our source code to a git repository in TFS. 我们已经使用TFS(内部)进行版本控制很长时间了,最​​近我们将源代码移到了TFS中的git存储库中。 The Git functionality inside Visual Studio works great for everyone but some of our users have authentication problems working with Git in external tools from the command line or Git Extensions. Visual Studio中的Git功能对每个人都适用,但是我们的一些用户在通过命令行或Git扩展程序在外部工具中使用Git时存在身份验证问题。 They are prompted for username and password every time a command is issued and then an error message is shown. 每次发出命令时都会提示他们输入用户名和密码,然后显示错误消息。 I don't have the exact error message right now but it's something like "user information could not be retrieved". 我现在没有确切的错误消息,但是有点像“无法检索用户信息”。

Basic authentication is enabled in IIS on the TFS server and if we disable Windows authentication the external tools work ok for all users. 在TFS服务器上的IIS中启用了基本身份验证,如果我们禁用Windows身份验证,则外部工具对所有用户都可以正常工作。 But this causes problems with other tools that access our TFS server and require windows authentication. 但这会导致其他工具访问我们的TFS服务器并需要Windows身份验证而引起问题。 It's also a minor pain to require a log in in the web browser every time you access our TFS website. 每当您访问我们的TFS网站时,都需要在Web浏览器中登录也是一个小麻烦。

The strange thing is that it works great for most user but a few have this problem. 奇怪的是,它对大多数用户都很好用,但是有一些问题。 We all have the same version of Visual Studio (2015 update 1) and the same version of all Git tools. 我们都有相同版本的Visual Studio(2015年更新1)和所有Git工具的相同版本。 All users are on premise logged in to the same domain. 所有用户都必须登录到同一域。

Did you try using the Git Credential Manager for Windows ? 您是否尝试过使用WindowsGit Credential Manager Please ensure that GCM is set as default by running git config credential.helper manager . 请通过运行git config credential.helper manager确保将GCM设置为默认值。 Finally, if you haven't already done so it may be best to use your UPN as the username. 最后,如果您尚未这样做,最好使用UPN作为用户名。

The simple solution was to just hit enter and leave username and password empty when prompted. 一种简单的解决方案是仅按Enter键,并在出现提示时将用户名和密码保留为空。 After that it started working and the external tools no longer prompts for credentials. 之后,它开始工作,并且外部工具不再提示输入凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM