当前位置:
首页 >
行业知识 >
git拉取失败,没有权限:Please make sure you have the correct access rights and the repository exist
行业知识
git拉取失败,没有权限:Please make sure you have the correct access rights and the repository exist
2026-10-24 02:34:43
来源:互联网转载
git���取项目,出现以下:
fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
提示错误显示为没有权限,主要是因为不同设备上的ssh公钥不同,导致git仓库公钥出现问题,需要重新重新生成ssh公钥即可解决
首先在git官网下载git工具Git - Downloading Package (git-scm.com)
1.重置用户名和邮箱:
打开Git Bash 进入Git命令,在需要提交的项目根目录下,输入以下命令来设置名字和邮箱(该处填写的名字和邮箱为github上的用户名和邮箱)git config --global user.name "你的名字" //xxxgit config --global user.email "你的邮箱" //xxx@qq.com
2.删除known_hosts文件:
打开C盘用户下的.ssh文件夹,地址是C:\Users(用户)\Administrator\.ssh,删除known_hosts文件
3.生成公钥认证所需的公钥和私钥文件,在C盘.shh文件夹里打开git bash,Git输入命令:
ssh-keygen -t rsa -C "你的邮箱" y之后就一直回车直到完成所有步骤
4.复制公钥:
完成第3步后,此时.ssh文件夹里出现了两个文件,分别为 id_rsa(密钥)和id_rsa.pub(公钥),用记事本打开id_rsa.pub并全选复制其中的内容,密钥格式是以邮箱结尾的
5.设置公钥:
进入自己的git仓库主页,进入设置界面,进行ssh密钥设置
6.在项目目录里打开Git Bash,输入命令:
git clone git@xxxxxxx 按回车,然后出现一串字,并输入yes,再回车,成功
上一篇文章,
vue2踩坑之项目:<template v-for> key should be placed on the <template> tag_意初的博客-CSDN博客vue2踩坑之项目: key should be placed on the tag.2.使用scope插槽的template被包裹使用v-for的template包裹。1.将template直接换成p。https://blog.csdn.net/weixin_43928112/article/details/131191542
上一篇:民办学校课程备案和公示管理制度
下一篇:轻松上手,开源代码下载攻略!