问题
Please make sure you have the correct access rights and the repository exists.[Windows]
解决方案
重新配置秘钥信息;
文章目录
全文命令使用 git bash 执行;
1. 重置 git 用户的名字和邮箱
# 设置全局 git 用户名称和邮箱;
git config --global user.name "yourname"
git config --global user.email "xxxx@exp.com"
2. 重新生成 ssh 密钥对
# 如不设密码,直接回车到底;
ssh-keygen -t rsa -C "xxxx@exp.com"
3. 删除 .ssh 文件夹下的 known_hosts
# 如涉及其他 ssh 连接,也可以通过只删除相应的行;
rm -rf ~/.ssh/known_hosts
4. 拷贝公钥到托管服务
将 ~/.ssh/id_rsa.pub
文件中的内容拷贝至 GitHub
/Gitee
的 SSH 公钥设置中;
5. 尝试 ssh 到 GitHub/Gitee
这一步会重写 known_hosts
;
# 使用 git bash 执行
ssh -T git@github.com
# 或
ssh -T git@gitee.com
PS:感谢每一位志同道合者的阅读,欢迎关注、评论、赞!