- 报错:Please make sure you have the correct access rights and the repository exists.
- 原因:本地没有SSH Key存在
- 解决:
-
首先为系统设置github的用户名和自己的邮箱
git config --global user.name "****" git config --global user.email "****@xxx.com"
-
生成ssh key,邮箱填刚才设置的邮箱
ssh-keygen -t rsa -C "****@xxx.com
会弹出
Generating public/private rsa key pair. Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):
一直回车默认选项即可
-
打开.ssh文件夹下的id_rsa.pub 复制其内容
vim /home/用户名/.ssh/id_rsa.pub
-
打开GIthub中的设置,按步骤添加即可
-
测试
ssh -T git@github.com
-
06-15
4113
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-21
2732
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-28