7

I have created a private repo in github and when I am trying to clone it using cmd (git), I am prompted with github window where I enter my username and password. It says login failed in the cmd and then asks username/password in the cmd. I enter the credentials again and press enter. I get error like fatal: Authentication failed for

I performed the above operation using https. when I tried with ssh, i get this error git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

How can I clone this private repository?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
kakashiOfSharingan
  • 121
  • 1
  • 1
  • 7
  • 1
    Have you tried using SSH? –  Oct 28 '21 at 16:39
  • yes @Joe . I have edited the question by adding the error i am getting while trying with ssh – kakashiOfSharingan Oct 28 '21 at 16:45
  • Did you setup your key locally and on github? https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account –  Oct 28 '21 at 16:46

1 Answers1

6

Github no longer supports basic account credentials (username and password). You have to generate a personal access token to proceed. follow these steps here: Generate Personal Access Token

I use Webstorm IDE and it made this very easy to fix. I hope this works for you.

Chris Josh
  • 389
  • 3
  • 7