Git "could not read from remote repository. Please make sure your have the correct access rights. Solution __git

Source: Internet
Author: User
Tags using git git clone

We sometimes encounter such problems when using Git clones or other commands, as shown in the figure:

Fatal:could not read from remote repository.


Please make sure your have the correct access rights

and the repository exists.

Fatal:could not read from remote repository. Please make sure your have the correct access rights and the repository exists.

This problem occurs because the SSH key solution is not added to the GitHub account as follows:

1. In the terminal input.

Ssh-keygen-t rsa-c "username" (Note: username for you git on the username)

If the execution succeeds. Return

Generating public/private RSA key pair.

Enter file in which to save the key (/USERS/USERNAME/.SSH/ID_RSA): Generating public/private RSA key pair.
Enter file in which to save the key (/USERS/USERNAME/.SSH/ID_RSA):

First of all, explain that the username here is the username on your computer.

Then, here's where to set up the storage address. We'll just press enter and there's one of two situations:

(1) If normal operation, will appear

Enter passphrase (empty for no passphrase):

Then we go straight to the car.

(2) Sometimes we may appear

/users/your Username/.ssh/id_rsa already exists.

Overwrite (y/n)? This means that you have set the storage address, we enter "Y" overlay

Overwrite (y/n)? Y

Enter


Any two of the above cases will appear

Enter same passphrase again: return again, at which point you will see:

Your identification has been saved In/users/username/.ssh/id_rsa.

Your public key has been saved in/users/username/.ssh/id_rsa.pub.

The key fingerprint is:

58:42:8b:58:ad:4b:b5:b9:6d:79:bf:8c:f9:e2:2b:ed username

The key ' s Randomart image is:

+--[RSA 2048]----+

| ...          |

|         O oo. |

| .        . ooo. |

| o o+ |

| . ..       OS. |

| . .      + . |

| .     O. |

| .    o+. |

|   +e++. |

+-----------------+

This indicates that the SSH key has been generated. The file directory is:/users/username/.ssh/id_rsa.pub.

We execute the cat command to view the contents of the file:

Cat/user/username/.ssh/id_rsa.pub

This time you will see:

Ssh-rsa aaaab3nzac1yc2 ..... I omitted the following.

(Note: Ssh-rsa The following content this is your SSH keys)

Add the SSH keys shown directly to the SSH keys inside the GitHub account settings

And finally execute the git clone command.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.