Microsoft 引入了邀請 AAD 用戶加入 MSA 支持的 Azure DevOps 帳戶的選項。這對於將帳戶從“非託管”轉換為“託管”的公司來說非常有用,首先將帳戶所有權轉移給 AAD 用戶,然後以較慢的方法修復用戶和許可混亂。
但是,當我嘗試使用 Visual Studio 2017 或 2019 克隆存儲庫時,收到一條錯誤消息:
Git 因致命錯誤而失敗。身份驗證失敗:{remote-url}。
或者,取決於您擁有的 Git 憑證管理器版本:
error: cannot spawn askpass: No such file or directory fatal: could not read Username for '{remote-url}': terminal prompts disabled`
When cloning from the command line, there are no issues and afterward, Visual Studio can also use the resulting git repository.
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.
After chatting with Chad Boles (who maintains Team Explorer in Visual Studio), we worked out another option. This is preferred over overwriting the files in the Visual Studio installation as this may break future updates and can cause hard to debug issues in the future.
更新您的全局 git 配置以指向 Git 憑證管理器的特定實現:
c:\>git config --global --edit
更新該[credential]
部分以閱讀:
[credential]
helper = C:\\\\Program\\ Files\\\\Git\\\\mingw64\\\\libexec\\\\git-core\\\\git-credential-manager.exe
確保路徑指向可以在您的系統上找到最新 Git Credential Manager 的位置。注意使路徑在全局 git 配置中工作所需的所有轉義。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句