git: authentication failed for URL on windows

2.59K viewsProgrammingauthentication clone error failed git
0

When I try to clone a remote git repo on windows, I get the below error

remote: Unauthorized
fatal: Authentication failed for ‘<URL>’

How do I fix this ?

Edited question
1

Here is how to fix it on windows:-

Go to Control panel and search for Credentials Manager and click on it.

It will have 2 tabs web credentials and windows credentials, select windows credentials. See screenshot below

Once selected, select Add a generic credential and it will ask for below 3 fields

  • Remote host/URL
  • username
  • password

See screenshot below

As seen above enter the remote hostname/website address like

git:https://<url>

provide the username and password. 

Now open command prompt and try to clone the repository again, it should work !!

Hope this helps someone who runs into a similar issue.

Answered question
Write your answer.

Categories