Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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.

like image 968
AskYous Avatar asked Dec 07 '18 00:12

AskYous


People also ask

How do I resolve Git fatal authentication failed?

It happens if you change your login or password of git service account (Git). You need to change it in Windows Credentials Manager too. type "Credential Manager" in Windows Search menu open it. Windows Credentials Manager->Windows Credential and under Generic Credentials edit your git password.

How do I authenticate my credentials in Git?

There are three main approaches you can take: Using a personal authentication token or password. Using an SSH key. Using your GitHub password with 2-factor authentication.


2 Answers

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”"

like image 85
VonC Avatar answered Oct 01 '22 06:10

VonC


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.

like image 31
Gonzalo Garcia Avatar answered Oct 01 '22 04:10

Gonzalo Garcia