问题出现:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists
解决方法
在终端输入: ssh-keygen -t rsa -C "用户名"
终端出现:
Generating public/private rsa key pair.
Enter file in which to save the key (/User/****//.ssh/id_rsa):
按下回车
终端出现:
/User/****/.ssh/id_rsa already exists.
Overwrite (y/n)? y
输入y 再 回车
终端出现:
Enter passphrase (empty for no passphrase):
按下回车
终端显示:
Enter same passphrase again:
最后回车出现:
Your identification has been saved in /c/Users/HVC/.ssh/id_rsa
Your public key has been saved in /c/Users/HVC/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:48tlPUvT66zCQgrP3FPw97M/fYg2QmBA1bwn4fCREl4 HVC
The key's randomart image is:
+---[RSA 3072]----+
| ...o+E. |
| ..o.* |
| ..= + |
| + = . |
| .S+ o |
| . ...+... |
| = +.+o.=o...|
| =.+++.+=+oo|
| oo +o+=++|
+----[SHA256]-----+
然后就可以看到我们SSH key存放的目录了,然后去git添加进去
就不会出现上述问题了