44

I typed wrong ID (my mistake) and I think my computer's IP is permanently banned. I'd like to un-ban my IP so that I can git clone to my desired git repository. But when I tried to git clone my git repository, it says remote: HTTP Basic: Access denied fatal: Authentication failed for "~~my repository"

How can I access my git repository again? Or how can I reset my banned state? I think typing a wrong ID only once and be permanently banned is somewhat harsh.

MyBug18
  • 2,135
  • 2
  • 11
  • 25
  • 4
    Possible duplicate of [Remove credentials from Git](https://stackoverflow.com/questions/15381198/remove-credentials-from-git) – ikh Jul 29 '18 at 15:03
  • 1
    Answer is already given on : https://stackoverflow.com/questions/47860772/gitlab-remote-http-basic-access-denied-and-fatal-authentication/51042334#51042334 – Bharti Ladumor Oct 12 '18 at 10:09

5 Answers5

93

It seems that your credential manager stored wrong authentication and reuses it. Reset it.

git config --system --unset credential.helper

More information:

Remove credentials from Git

GitLab remote: HTTP Basic: Access denied and fatal Authentication

ikh
  • 10,119
  • 1
  • 31
  • 70
  • 19
    If on windows you get a permission denied message just run your cmd as administrator – Gustavo Ulises Arias Méndez Feb 26 '19 at 19:57
  • good, solved the problem like a charm (on a fresh new install) – jancha Feb 03 '20 at 07:06
  • As much as it might “work” it does not seem to be sane, and it probably won't work the second time around. Because that config is setting where to store the credentials, not storing the credenaials. So by this command you switch to different location for storing credentials, which has the effect of not having them, but a) it's less secure and b) next time you won't have any third place to switch to. – Jan Hudec Mar 21 '22 at 14:23
5

I think this article may serve you better: Github OpenSSH asking for password for an https link

To unset the git config --system --unset credential.helper command, you can do type git config --system credential.helper store (maybe also with --global and --local flag)

tturbo
  • 680
  • 5
  • 16
2

@ikh's answer works, but I had to set it to it's original value afterwards:

$ git config --system credential.helper
manager-core
$ git config --system --unset credential.helper
 ... log in again and be prompted for credentials ...
$ git config --system credential.helper manager-core

It's still quite a hack.

1

In Windows 10,

Open Control Panel\All Control Panel Items\Credential Manager path via file explorer or search "Credentials Manager" keyword from windows bottom search field. Then click the "Windows Credentials" section.

Select your git server and than click the edit button as shown the picture. Lastly, update your credentials. Save it.

enter image description here

burak isik
  • 395
  • 5
  • 6
0

If the cached credential app is storing wrong data you need to remove cached/stored credentials from there. To see how to remove from wincred see Remove credentials from Git


Resetting credential app

The auth can be broken at different levels.

#list all 
git config --list --show-origin --show-scope |grep credential.helper
#reset
git config --system --unset credential.helper
git config --global --unset credential.helper
git config --local --unset credential.helper

In my case was at global (user)

global  file:d:/home/raiser/.gitconfig  credential.helperselector.selected=wincred
raisercostin
  • 8,777
  • 5
  • 67
  • 76