When cloning git repositories in automated tools - web front ends, CI systems, sometimes the git clone invocation opens up a prompt asking for the username and password (for example, when cloning a. Mar 11, 2019 Authentication failed on the git remote After checking the repo permissions, as Cece - MSFT suggested for the repo I am currently trying (although this is happening for all of them), I can see that I have full permissions (although my screenshot looks quite different).
If I attempt to run the following command, it fails with authentication failed.
If I just run
It prompts for a password, which when supplied, it authenticates successfully and clones the repository.
If I don't supply anything, it prompts for the username and password, which when entered, it works as expected.
Why can't I clone when I supply the username and password in the url but I can when I just supply the username?
shaboinkinshaboinkin
Browse other questions tagged gitteam-foundation-server or ask your own question.
I am trying to use git to push my repository to a visual studio team services project, but I get the error:
I am using the cmds:
Any idea of the fix for this?
Thanks!
Daniel Mann41.2k77 gold badges6868 silver badges9292 bronze badges
GurdeepSGurdeepS26k8181 gold badges217217 silver badges353353 bronze badges
11 Answers
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.
kxiaocaikxiaocai
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?
and set it up.
CodeWizardCodeWizard58.6k1212 gold badges7676 silver badges102102 bronze badges
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.
Giulio VianGiulio Vian7,19722 gold badges2525 silver badges3636 bronze badges
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
MaxMax
Delete '.git/config' and try again. Attention this will may reset some git settings too!
I've tried alternative credentials and Personal Access Token for many times with right credential and it kept telling me 'fatal: Authentication failed'.
Finally, I found there is a file named '.git/config' located at the root of my Repo. I deleted this file and type in my credentials again, it worked.
Bruno Bieri4,70055 gold badges4343 silver badges6666 bronze badges
Longfei WuLongfei Wu
I suddenly started receiving this error when attempting to push changes from VS2017 to a VSTS Git repository. This functionality had worked the day before.
I checked my git.log file and saw a different exception :-
19:43:57.116665 ...zureAuthority.cs:184 trace: [ValidateCredentials] server returned: 'Unable to connect to the remote server.
I downloaded the latest Git CredentialManager source from Gits Credential Manager repo and debugged it.
Once authenticated, the following exception occurred :-
No connection could be made because the target machine actively refused it 127.0.0.1:8888
I then realised that I had recently setup Fiddler to act as a proxy for all services as per the article capturing-traffic-from-.net-services-with-fiddler
Once I ran Fiddler, I was able to successfully connect.
Mr SlimMr Slim1,11333 gold badges1414 silver badges2323 bronze badges
I've tried lots of options, but the one that worked for me was to:
- Download the Git Password Manager from its Releases section
- Try to do simple
git fetch
which will automatically bring the window(alternate to default windows one for example) and ask to enter username and password but with more elegant way than the standard one.
After correctly entering the credentials it worked, though I was getting an error before.
P.S. If you are getting 'Wrong Credentials' kind of errors always check if the repository username and password are correct. If you hesitate just reset the password and try to use the same one in the Git Password manager window.
Arsen KhachaturyanArsen Khachaturyan3,67011 gold badge1818 silver badges2626 bronze badges
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.
2,07877 gold badges1919 silver badges2626 bronze badges
Anusha M ShettyAnusha M Shetty
All i needed were the correct credentials. while deploying to a web app, i had to go to Deployment Center, Deployment Credentials. And then use either the App Credentials or create User Credentials. After this, delete the cached credentials on the local machine (windows: Control PanelUser AccountsCredential Manager). run 'git push webapp master:master' again, enter either of the Deployment Credentials. This worked for me.
maheshmahesh
My solution was a little bit different and faster :)
- Go to Windows Credentials (Start-> Windows Credentials) and remove credentials for your repository (they starts with git:xxx)
- Go to VSCode and in Terminal write:config credential.helper wincred
- Go to Visual Studio (no VSCode) and make a git pull. A popup will show asking for credentials. Put your credentials for the repo
- Go to VSCode and make a git pull. Credentials were automatically fetched from wincred store
Credentials are automatically created and stored in wincredentials, so the next time you cannot be asked for credentials. (also a Personal Access Token will be provided from visualstudio.com if you are using DevOps hosted git repo).
Antonio BuonaiutoAntonio Buonaiuto
I had the same problem, I tried to update my password using windows credential manager, it still didn't fix the issue
Control Panel --> Credential Manager --> Manage Windows Credentials --> Choose the entry of the git repository, and Edit the user and password.
I then deleted all the git related entry in credentials manager and then tried to use Git using visual studio, this time it prompted for new credentials
Web Application DeveloperWeb Application Developer