使用Visual Studio 2017或2019和AAD帐户从MSA支持的Azure DevOps克隆存储库 [英] Cloning repository from MSA backed Azure DevOps using Visual Studio 2017 or 2019 and AAD account

查看:184
本文介绍了使用Visual Studio 2017或2019和AAD帐户从MSA支持的Azure DevOps克隆存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft引入了邀请AAD用户加入MSA支持的Azure DevOps帐户的选项.这对于将帐户从非托管"过渡到托管"的公司非常有用,首先是将帐户所有权转移给AAD用户,然后以较慢的方式修复用户和许可混乱.

Microsoft has introduced the option to invite AAD users into MSA backed Azure DevOps accounts. This is great for companies that are transitioning accounts over from "unmanaged" to "managed", starting with transferring account ownership to an AAD user and then fixing the user and licensing mess in a slower approach.

但是,当我尝试使用Visual Studio 2017或2019克隆存储库时,收到一条错误消息:

However, when I try to clone a repository using Visual Studio 2017 or 2019, I'm greeted with an error message:

Git因致命错误而失败.验证失败:{remote-url}.

Git failed with a fatal error. Authentication failed for: {remote-url}.

,或者,取决于您拥有的Git凭证管理器的版本:

or, depending on which version of the Git credential manager you have:

错误:无法生成AskPass:没有这样的文件或目录 致命:无法读取"{remote-url}"的用户名:终端提示已禁用

error: cannot spawn askpass: No such file or directory fatal: could not read Username for '{remote-url}': terminal prompts disabled`

从命令行克隆时,没有任何问题,之后,Visual Studio也可以使用生成的git存储库.

When cloning from the command line, there are no issues and afterward, Visual Studio can also use the resulting git repository.

推荐答案

更新

最新版本的os Visual Studio 2017(15.9.10+)现在包含Git Credential Manager 1.18.4版本,应该可以解决由旧版本引起的许多问题.如果您需要更新版本的GCMfW,同样的技巧也应适用于较新的版本.

The latest version os Visual Studio 2017 (15.9.10+) now contains version 1.18.4 of the Git Credential Manager and should solve many of the issues that were caused by the older versions. Should you need a more recent version of the GCMfW, the same trick should work for newer versions too.


与Chad Boles(在Visual Studio中维护Team Explorer)聊天之后,我们找到了另一个选择.与覆盖Visual Studio安装中的文件相比,这是首选方法,因为这可能会破坏将来的更新并可能导致将来难以调试问题.

  1. 安装最新的GCMW-1.xx.xx.exe 在您的系统中和/或更新到最新版本的适用于Windows的Git 包括GCM.
  2. 更新全局git配置以指向Git凭据管理器的特定实现:

  1. Install the latest GCMW-1.xx.xx.exe in your system and/or update to the latest version of Git for Windows which should include GCM.
  2. Update your global git config to point to a specific implementation of the Git credential Manager:

c:\>git config --global --edit

[credential]部分更新为:

[credential]
    helper = C:\\\\Program\\ Files\\\\Git\\\\mingw64\\\\libexec\\\\git-core\\\\git-credential-manager.exe

确保路径指向可以在系统上找到最新Git Credential Manager的位置.注意使路径在全局git配置中起作用所需的所有转义.

Ensure the path points to where the latest Git Credential Manager can be found on your system. Mind all of the escapes needed to make paths work in the global git config.

这篇关于使用Visual Studio 2017或2019和AAD帐户从MSA支持的Azure DevOps克隆存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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