0

When I try to clone a private repo I get the following error, after being asked for username and password:

fatal: Authentication failed

I've tried reinstalling the latest git and rebooting windows 10.

Another thing I've tried from github website settings was removing/deleting the authorization for Personal access token (with the name of the problematic machine I'm trying to connect to). Before I was also getting an error like "unable to get local issuer certificate"

The problem started today when I upgraded tortoisegit and it asked to close some applications, among which there was explorer and I'm afraid that it killed it in the wrong way and something got corrupted.

Giulio
  • 173
  • 2
  • 23
  • Do you have access to the repo? Did you pass the correct username and password when git prompted you? – CodeTalker Apr 08 '20 at 22:36
  • Does your password contains '@'? – CodeTalker Apr 08 '20 at 22:44
  • Try using SSH instead of HTTPS. It is advised to use SSH over HTTPS. – CodeTalker Apr 08 '20 at 22:47
  • Here you go https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent – CodeTalker Apr 08 '20 at 22:49
  • Any reason to unaccept the answer? – CodeTalker Nov 03 '20 at 09:44
  • @codetalker a couple of reasons: one is that there is a follow up question clarifying that the only real problem was due to cyberark endpoint and bluecoat. It is important to clarify that is a terrible product, unfortunately purchased and used by my company. Issue not to be confused with technical settings. Another similar reason is related to other aspects of this forum... Anyway, accepted again. – Giulio Nov 03 '20 at 10:30

1 Answers1

1

Seems like you messed up your access token. I recommend you to setup new SSH keys for your machine and add them to GitHub repo. You can Follow this official help page from github.

Another way to clone without SSH is to clone using HTTPS, here the syntax for the clone is slightly different from public repositories. For public repos, you go like

git clone https://github.com/myUserName/myProject.git

For private repo, you go like

git clone https://myUserName:myGithubPassword@github.com/myUserName/myProject.git

Note:

  • If your password contains special characters, you will need to convert password with special characters to UTF-8 encoding. You can take replace guide from here. Or you can use this javaScript code to convert your password and use generated password console.log(encodeURIComponent('password_of_the_form@$123'));
  • If you use 2FA to secure your GitHub account then follow this
CodeTalker
  • 1,201
  • 11
  • 21