当前位置: 代码网 > it编程>数据库>Access > git远程操作异常:correct access rights问题及解决

git远程操作异常:correct access rights问题及解决

2025年03月18日 Access 我要评论
git远程操作异常:correct access rights问题please make sure you have the correct access rights and the reposit

git远程操作异常:correct access rights

问题

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

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com