我正在尝试以编程方式克隆git存储库.我的ASP.NET MVC应用程序正在创建和启动一个进程.处理进程的代码可以正常工作,但是当尝试使用TFS内部部署PAT来克隆git存储库时,身份验证失败.我无法使用NTLM或要求用户输入凭据.我可以确认我的C#代码处理创建进程以编程方式使用git bash shell,因为我在本地计算机上没有问题但在IIS上生产时出现了问题.我尝试了以下两种方法.
方法1:git clone http:// anyusername:PAT @ tfs2017:8080/tfs/DefaultCollection/_git/Git%20Repository
PAT是我为用户生成的令牌.我也试过在base64中对它进行编码.
方法2:正如MS社交论坛上的人所建议的那样.
git -c http.extraheader ="AUTHORIZATION:bearer { base64encodedPAT }"clone { url }
原MS论坛问题参考: https ://social.msdn.microsoft.com/Forums/vstudio/en-US/0107cf1f-7fe4-4429-af74-ca7d2be7405e/using-personal-access-tokens-in-tfs-2017 ?论坛= tfsversioncontrol
我无法从Azure DevOps克隆一个简单的存储库。操作系统:Ubuntu 18.10
我这样做:
git clone https://myorganization.visualstudio.com/myproject/_git/myrepo/ 我不断收到来自Git的消息:
fatal: Authentication failed for 'https://myorganization.visualstudio.com/myproject/_git/myrepo/'
我正在阅读其他人的解决方案,但没有一个对我有用。我也试过这个:
授权:基本Base64Encoded(uname:PAT)
授权:承载式PAT
任何线索为什么这不起作用?