Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
835 views
in Technique[技术] by (71.8m points)

git - Cloning repository from MSA backed Azure DevOps using Visual Studio 2017 or 2019 and AAD account

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.

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

enter image description here

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

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Update

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.

  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
    

    Update the [credential] section to read:

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

    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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...