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.