git: authentication failed for URL on windows

2.29K viewsProgrammingauthentication clone error failed git

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

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


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.