Authentication failed for https://xxx.visualstudio.com/DefaultCollection/_git/project
Solution 1
I had a same issue recently (visual studio 2017 & Windows 10), and solved it using the following method:
Control Panel --> Credential Manager --> Manage Windows Credentials --> Choose the entry of the git repository, and Edit the user and password.
Done.
Solution 2
If you wish to use GIT CLI and not interact with the build in GIT wrappers in Visual Studio you need to enable Alternate Authentication Credentials
How?
Open your account (VS Online account)
-> click on your name on the top right
-> My Profile
-> Credentials.
and set it up.
Solution 3
I have faced the same issue. The error output window looks like this:
Following the steps resolved the issue:
- Go to Control Panel --> Credential Manager --> Windows Credentials
-
Below Generic Credential, choose an entry of the git & update password.
Password should be same as windows(system) login password.
Solution 4
The best option today is to install https://github.com/Microsoft/Git-Credential-Manager-for-Windows that supports VSO, GitHub and is improving every month.
Solution 5
With VSTS the url is, When you copy git clone url from vsts you always get
https://orgname@dev.azure.com/org/project/_git/repo
Replace orgname@ with your alternate username that you would have created in VSTS -> profile -> Security.
final git url -
https://alternateusername@dev.azure.com/org/project/_git/repo
GurdeepS
Updated on February 10, 2022Comments
-
GurdeepS about 2 years
I am trying to use git to push my repository to a visual studio team services project, but I get the error:
fatal: Authentication failed for (url of team project)
I am using the commands:
git remote add origin https://XXXXXXX.visualstudio.com/DefaultCollection/_git/project git push -u origin -–all
Any idea of the fix for this?
-
Lukos over 7 yearsSecurity is a separate item in the menu now. If you click profile, it goes to a very different page.
-
CodeWizard over 7 yearsit may vary between versions. this is why i added screenshot
-
Deilan almost 7 years@dotnetdev Please accept this answer 'cause this is a recommended way of resolving the issue.
-
Breeno over 6 yearsThis is also available for Mac and Linux at github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux - worked perfectly for me without having to add less-secure "alternative credentials".
-
Stephane over 5 yearsThis is indeed the "de facto" solution that microsoft provided. Other solutions that indeed work here shall be considered as tweaks.
-
Josh Gust over 5 yearsI have not had to do this. Using a PAT for Git Bash seems to be working just fine.
-
Edward Thomson about 5 yearsPlease use a PAT instead of alternate credentials.
-
Even Mien almost 5 yearsI used this method when my Personal Access Token expired. Go to <<URL>>/_usersSettings/tokens to create a new one and then set it as the password in Credential Manager.
-
Highriser over 4 yearsStart-> Windows Credentials works like a charm! Thanks!
-
Giulio Vian over 4 yearsEnabling Alternate credential is not recommended: domain credentials transit in clear-text and may ends up in Application Tier IIS logs
-
marcogmonteiro over 3 yearsOP didn't said anything about this being in cpanel.
-
Dominik Sajovic over 3 yearsGod.... thank you. This is the only solution that worked for me.
-
bryanbcook over 3 yearsI have multiple logged in credentials -- this was the easiest and most direct way to ensure that it uses the correct cached credential.
-
Enrico about 3 years"Alternate credentials have been disabled on this organization"
-
Kevin almost 3 yearsI only had to delete the entry from Windows Credentials to resolve my issue.
-
Namitha almost 3 years@Kevin - You have to Edit User name and password in windows credentials, then it will resolve.
-
JKH almost 3 yearsThis worked for me as well. Good solution.
-
Slavik N almost 3 yearsThe answer needs to be improved, to include explanations.
-
Pavan N over 2 yearson giving my machine password didn't worked, i generated personal access token (PAT) from VSO and used it. then in VS2019 am able to pull latest.