'"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://[email protected]/....

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



Solution 1:[1]

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%[email protected]/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”"

Solution 2:[2]

What solved my issue was:

  1. Create the repository from https://dev.azure.com/

  2. From the repository view, create your credentials with name and password enter image description here

  3. Now in the console you can clone your repository by changing the url that azure provides you initialy as

git clone https://<companyname>@dev.azure.com/<companyname>/<project name>/_git/<repository name>

to

git clone https://<your credentials name>@dev.azure.com/<companyname>/<project name/_git/<repository name>

now it will ask you for a password. You must use the one you provided when you created the credentials.

Solution 3:[3]

The same error (Windows, Git Bash command line). Using https (not ssh) which should prompt for login credentials but instead errors:

$ git pull origin master
fatal: Authentication failed for 'https://github.com/frmbelz/my_git_project.git'
$ git config -l
...
credential.helper=manager
...

$ git config --global --unset credential.helper
$ git config --system --unset credential.helper

git pull now prompted for username/password prompts.

Solution 4:[4]

A solution I found is to use a personal access token (PAT). It's located in the "clone" tab. It worked very easily.

Solution 5:[5]

I added sudo to my git push command and i was prompted to enter my github credentials and it worked

sudo git push

Solution 6:[6]

FWIW, I found that I had to use the Git-Credential-Manager-Core utility:

https://github.com/microsoft/Git-Credential-Manager-Core

Solution 7:[7]

You can reconfigure Git Credential Manager by running:

git credential-manager-core configure

Result:

Configuring component 'Git Credential Manager'...

Configuring component 'Azure Repos provider'...

Solution 8:[8]

Right so my colleague and I were having the same trouble (didn't have this issue on windows, only on mac) and the above solution worked for him and didn't work for me. I had to create a Personal Access Token (PAT) via this guide Authenticate Access With Personal Access Tokens.

Then in iTerm: git clone https://octavialo%40organizationname:[email protected]/organizationname/reponame

%40 is a stand in for the @ sign. I sign in to azure with [email protected]

I also tried with this, where foobar was the name I gave the token: git clone https://foobar:[email protected]/organizationname/

I think the issue could have been with my password which had special characters.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Gonzalo Garcia
Solution 3 frmbelz
Solution 4 AskYous
Solution 5 Ngodza
Solution 6 Rod
Solution 7 asbin
Solution 8 OctaviaLo