【问题标题】:How to enter git credentials on commandline for visualstudio.com?如何在 Visualstudio.com 的命令行上输入 git 凭据?
【发布时间】:2016-02-02 09:54:59
【问题描述】:

我尝试访问托管在 VS Team Services 上的 git 存储库。在 Visual Studio 中工作正常,但我需要使用标准 git 客户端从命令行访问。

当我尝试执行 pull 之类的命令时,系统会要求我提供凭据。现在我的问题是我的凭据是使用我的电子邮件和密码的 MSDN 帐户数据。

在 git 命令行中输入我的电子邮件后,我可以看到它尝试构建一个密码 URL,但由于地址中有两个“@”而无法工作:

git clone https://myproject.visualstudio.com/DefaultCollection/_git/coderepo
Username for 'https://myproject...':  myself@mydomain.com
Password for 'https://myself@mydomain.com@myproject...' :

输入密码后,我收到(毫不奇怪)“致命:身份验证失败”

那么:如何在 git 中使用电子邮件作为用户名凭据?

【问题讨论】:

  • 无关:你会对this感兴趣,以避免每次都输入它们。

标签: git azure-devops


【解决方案1】:

自己找到了解决方案。

在 VS Team Services 中,https://[projectname]mydea.visualstudio.com/_details/security/altcreds

可以使用真实用户名(无电子邮件)输入“备用身份验证凭据”

【讨论】:

    【解决方案2】:

    您可以使用 alternate credentialspersonal access token 访问 Team Services 托管的 Git 存储库。

    更方便的方法是使用Git Credential Manager for Windows。当您需要访问 Team Services Git 存储库时,此工具会提示一个 Team Services 登录对话框,您只需在其中直接输入您的 Team Services 帐户凭据即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-27
      • 1970-01-01
      • 1970-01-01
      • 2020-07-31
      • 1970-01-01
      • 2018-03-04
      相关资源
      最近更新 更多