gitazureazure-devopsgit-credential-manager

"fatal: Authentication failed" with git-credential-manager


I'm using Azure DevOps for the first time to host my next project. When I created an empty project on Azure Devops, I tried to clone it. While attempting to clone, it asked me for my password. I entered it and it says I have a wrong password but I know I'm typing my password correctly.

I then installed git-credential-manager for max/linux onto my mac. I tried to do a git pull from the remote origin, but it just prompted for a password like the first time and failed.

I also tried to use the "Create git credentials" feature on Azure Devops, in which I can specify a new password. That failed as well with the same error.

I submitted a GitHub issue on their repository here. Is there no way for me to clone my project? The url for my repository is in the form of https://yousefshanawany@dev.azure.com/....

Update: I tried this on my Windows machine and it gave me a popup to login and it worked fine.


Solution

  • Make sure your git credential helper is declared to your local Git:

    git config credential.helper
    

    If the output is empty, type:

    git config --global credential.helper manager-core
    

    Then try again.

    However, the OP AskYous correctly pinpoint another issue in the comment:

    Can I tell it what my username is?
    I think my username is my email address, because I use my organization account to sign in.

    In that case, the URL would be:

    https://me%40email.com@dev.azure.com/yousefshanawany/<repo-name>/
    

    Note the @ of the email must be percent-encoded.


    Note that using a PAT (Personal Access Token) is an alternative mentioned by the OP, and mandatory if you have 2FA activated.


    Update June 2019: This question was referenced in microsoft/Git-Credential-Manager-for-Mac-and-Linux issue 104, which just got closed with a comment from John Briggs from Microsoft:

    I'd recommend trying GCM Core's macOS preview release


    Maksym Pecheniuk points out in the comments:

    solution for IntelliJ Idea: "Git IntelliJ "Authentication Failed”"