1

Whenever I pull or push I am asked to choose an account from my organisation, of which there is only one account option (the other option is "sign in to a different account) I am not asked to re-enter my password after selecting this account either. Then I get a notification telling me the git-credential-manager has generated a Personal Access Token for my organisation on Azure DevOps. It now has about 90 of these tokens generated and none have expired. I have updated everything to the latest version, re-authenticated everything and still no luck.

This has only just started happening in the last few weeks. Anyone got any pointers on what to try next?

3
  • What do the URLs look like in your Credential Manager? What do the URLs look like that you're cloning? Finally, what do the URLs look like when you hit Azure DevOps over the web? I'm wondering if after account.visualstudio.com became dev.azure.com/account if you're storing credentials for one URL scheme but cloning another (and thus if Git is looking for credentials for the wrong URL and not finding them). Commented Jan 23, 2019 at 10:25
  • @EdwardThomson All my URLs are dev.azure.com ones. I had no projects hosted on DevOps before they switched from VSTS to DevOps. Commented Jan 23, 2019 at 10:28
  • Interesting. Talking to some of the engineers, it looks like there's a few possible things that might cause this. To avoid too much back-and-forth here in this little chat box, I'm going to post an answer that we can iterate on to collect all of the possibilities and solutions. Commented Jan 23, 2019 at 13:25

1 Answer 1

2

The most likely problem is that you have an old version of Git Credential Manager.

Azure DevOps recently changed its URL scheme (from the Visual Studio Team Services scheme). Git Credential Manager needs to know what type of hosting provider you're connecting to, since the negotiation for GitHub is different than the negotiation for Bitbucket is different than the negotiation for Azure Repos. It does this by looking at the URL information; this new URL scheme is only supported in newer Git Credential Manager versions. This support was added in GCM 1.18.

Make sure you're running the latest version of Git for Windows on the command-line. You should be able to git fetch and git push correctly.

Similarly, update to the latest version of Visual Studio 2017. VS 2017 includes its own version of Git for Windows and the Git Credential Manager.

There are a few other possible problems:

Git Credential Manager is storing these in the wrong user's credential store. This could happen if you were running a process elevated, for example. (Please don't run git as an elevated process.)

If neither of those is the problem, there may be a bug in GCM that we need to chase down.

Sign up to request clarification or add additional context in comments.

8 Comments

I'm running git version 2.20.1. git credential manager version 1.18.4. I'm not using the git command line, I'm using it through the visual studio team explorer. Visual studio is run as administrator and as a separate user account (this is necessary for the access required by the project)
It might be the elevation, but what version of VS are you using? It includes its own GCM. (You can find the version by running "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git" credential-manager version, assuming you're running VS 2017 Enterprise).
The version of that file is 2.14.4
Thanks - looks like even the latest version of VS 2017 doesn't have the newest GCM.
I've updated my answer to include a way to manually specify a version that should work properly.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.