Please make sure you have the correct access rights and the repository exists. The problem has been solved when Git clone appears.

After reading a lot of information, I finally figured out the error of the clone command in git. Don’t talk nonsense and go directly to the steps. I hope it will be helpful to everyone.

1 Delete known_hosts under the .ssh folder (search the folder directly) (delete manually, no need for git)

2 Open bash.exe in the bin directory of the downloaded Git and enter the command ssh-keygen -t rsa -C “username” (Note: username is your username on git) , if the execution is successful. return:

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): //where username is the user name on the computer, this address is also the storage address of the file, and then we press

Press Enter, if you have a storage address before, it will return /Users/your username/.ssh/id_rsa already exists. Overwrite (y/n)? Directly enter y and press Enter. It will appear if there is no storage address before

Enter passphrase(empty for no passphrase); also directly enter, in both cases Enter same passphrase again will appear after enter, and then enter will display a long list of contents

There are also some codes like ..o.. o oo .oS., which shows that the SSH key has been generated. The file directory is: username/.ssh/id_rsa.pub.

 

3  Then find that the system automatically generates two files in the .ssh folder, id_rsa and id_rsa.pub, open id_rsa.pub with Notepad and copy all the contents.

4  Open https://github.com/, log in to your account, and enter Settings to find

5 Then paste the content you copied into the key

Then click Add SSH Key

ok there is one last step

6 Still enter ssh -T [email protected] in bash.exe and then a bunch of content will pop up. You only need to enter yes and press Enter and you are done, and then he will prompt you that you are successful.

Then you can use the git clone command normally, and finally I wish you good luck haha!

Similar Posts: