解决“Please make sure you have the correct access rights and the repository exists."

push 博客的时候时不时就会遇到这样的问题,更新一下密钥就好了,记录一下方便以后使用

1. 删除原先的rsa文件

找到 .ssh 文件夹,删除里面的内容

2. 重置用户和邮箱

  • .ssh 文件夹中右键打开 git Bash
1
2
3
4
5
git config --global user.name ‘Awellfrog’

git config --global user.email ‘[email protected]
# 查看命令
git config --list

3. 生成新的密钥

1
ssh-keygen -t rsa -C "[email protected]"

一路回车

看到奇怪的图案就生成了

用记事本打开 id_rsa.pub

将其中的公钥复制到 github 仓库的公钥中

4. 连接测试

1
ssh -T [email protected]

输入上面命令,应该就正常了,如果出现下面错误

重连一下网络,科学上网,或者等一会再试就成功啦