访问 TFS git 存储库总是提示从 Visual Studio 外部输入用户名和密码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24736429/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Accessing TFS git repository always prompts for username and password from outside of Visual Studio
提问by schmendrick
I have set up a Team Foundation Server 2013 which natively supports git as source control. I have successfully created a project called "TestTeamProject". I set up 2 users for the TFS which are 2 domain users.
我已经设置了一个 Team Foundation Server 2013,它本机支持 git 作为源代码控制。我已经成功创建了一个名为“TestTeamProject”的项目。我为 TFS 设置了 2 个用户,它们是 2 个域用户。
Pusing/pulling from Visual Studio 2013 onto that works fine. But when i try to push/pull from the command line or Git Extensions tool, a console window will pop up EVERY TIME asking for username and password with
从 Visual Studio 2013 上推/拉到它工作正常。但是当我尝试从命令行或 Git 扩展工具推/拉时,每次都会弹出一个控制台窗口,要求输入用户名和密码
Username for 'http://myTFS:8080':
Password for 'http://example-username@myTFS:8080':
i tried to set up at least the username in git extensions / git settings, he still promts for both of them.
我尝试至少在 git 扩展名/ git 设置中设置用户名,他仍然提示他们两个。
i have used git before only via ssh where i then can generate a file that gets used for the credentials, but TFS does not support SSH protocol, so is there some way to be able to use TFS with git without needing to enter the credentials all the time when i push/pull from outside visual studio?
我之前只通过 ssh 使用过 git,然后我可以生成一个用于凭据的文件,但是 TFS 不支持 SSH 协议,所以有什么方法可以在 git 中使用 TFS 而无需输入所有凭据我从视觉工作室外部推/拉的时间?
git-tfs is not what i am looking for, because we want to use the native git support of TFS.
git-tfs 不是我要找的,因为我们想使用 TFS 的原生 git 支持。
we need to be able to use git outside of visual studio because not the whole development team is .NET based!
我们需要能够在 Visual Studio 之外使用 git,因为并非整个开发团队都基于 .NET!
Any ideas what i could do?
任何想法我能做什么?
采纳答案by Edward Thomson
Visual Studio should store credentials in the Windows Credential Manager, which is compatible with the Git Credential Winstore. If you install Git Credential Winstore, it should no longer prompt you at the command-line.
Visual Studio 应将凭据存储在与Git Credential Winstore兼容的 Windows 凭据管理器中。如果您安装 Git Credential Winstore,它应该不再在命令行提示您。
回答by pa1geek
https://confluence.atlassian.com/display/STASH/Permanently+authenticating+with+Git+repositories
https://confluence.atlassian.com/display/STASH/Permanently+authenticating+with+Git+repositories
This link has the details how to set up Git credentials for other than windows. I am putting this here in case someone stumbles through this question (like I did)
此链接详细介绍了如何为 Windows 以外的设备设置 Git 凭据。我把这个放在这里以防有人偶然发现这个问题(就像我一样)
回答by knocte
You can add alternative credentials in your TFS page, i.e.:
您可以在 TFS 页面中添加替代凭据,即:
https://username.visualstudio.com/_details/security/altcreds
https://username.visualstudio.com/_details/security/altcreds
(replace username
with the proper value)
(替换username
为适当的值)
回答by Darxis
A solution for me was to ensure that the Extended Protectionin Windows Authenticationin IISwas set to "Off". I also got "NTLM" and "Negotiate" as Providers.
我的一个解决方案是确保将IIS中Windows 身份验证中的扩展保护设置为“关闭”。我还获得了“NTLM”和“Negotiate”作为提供者。
Disabling the Extended Protection was the only solution to the problem in my case.
回答by schmendrick
I solved the problem myself.
我自己解决了这个问题。
It was not the server but in both the tried clients. On my Win7 64bit machines I had the problem that the path to git-credential-winstore.exe
was not found. both the last 2 versions of gitextensions (or is it git that makes the problem?) [version 246 and version 24703] seem to have a problem locating that.
它不是服务器,而是在两个尝试过的客户端中。在我的 Win7 64 位机器上,我遇到了git-credential-winstore.exe
找不到路径的问题。gitextensions 的最后 2 个版本(或者是 git 造成了问题?)[版本 246 和版本 24703] 似乎在定位它时有问题。
I fixed this by uninstalling gitextensions and installin gitextension and git again, but this time not to C:\Program Files (x86)\
but to C:\Linux\
.
我通过卸载 gitextensions 并再次安装 gitextension 和 git 来解决这个问题,但这次不是,C:\Program Files (x86)\
而是C:\Linux\
.
Strangely enough the program after installation cried that the paths are not correct (on startup he will show the path to the git.exe pointing to C:\Program Files (x86)\
which I then had to fix manually. But after that all worked!
奇怪的是,安装后的程序哭着说路径不正确(在启动时,他会显示指向 git.exe 的路径,C:\Program Files (x86)\
然后我必须手动修复该路径。但之后一切正常!