栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

使用git时出现Could not read from remote repository.Please make sure you have the correct access rights

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用git时出现Could not read from remote repository.Please make sure you have the correct access rights

        今天想在Vscode中访问一个 gitee 地址,想当然的就把地址复制过来,然后克隆里面的代码,但是出现 git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.的错误,因为本人对 git 不太熟练,所以去找了找解决办法。

         这是出现错误的截图:

        原因:远程仓库缺少本地git的SSH公钥导致无法认证,进而没有权限读取远程仓库。

        解决办法:本地生成SSH公钥,上传到Gitee/GitHub 个人公钥管理当中。

        下面以Gitee为例,一步步来解决 :

        重新输入:

ssh-keygen -t rsa -C "xxx@xxx.com"

        然后一直按回车就好,如下:

 

         注:因为我之前生成过秘钥,所以这里还有一个 Overwrite 环节。

        下一步就要重新把 ssh 公钥复制到 github 和 gitee 里面去。

        先去找到那个文件:

 

        然后用记事本打开,复制。

        然后登录github,如下,按顺序点击,把秘钥复制进去即可。

         然后登录 gitee,一样操作。

 

        至此,问题就解决啦,哈哈哈。 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/748221.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号