700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 关于Git使用:fatal: Could not read from remote repository.的报错问题解决

关于Git使用:fatal: Could not read from remote repository.的报错问题解决

时间:2024-02-13 14:10:28

相关推荐

关于Git使用:fatal: Could not read from remote repository.的报错问题解决

目录

一:问题描述

二:解决过程

1,增加账号及邮箱

2,添加秘钥:

3,获取公钥并将其设置到云效里面

4,宝塔终端 解除密码

三:解决截图

一:问题描述

我们公司的版本仓库用的是阿里云效,因为前一阵前任技术负责人离开公司,我登录阿里云效将其移出了团队。结果,发现我们的线上环境git pull时出现了“找不到代码库,请确认是否有权限且代码库路径正确”,这样的报错,英文的报错信息是:fatal: Could not read from remote repository

查阅资料后,得出原因:线上环境使用的ssh连接应该就是前任技术的,看来我需要重新创建一个,以我的账号创建。

经过,大约2小时的摸索努力,终于弄好了,现在将其过程分享给大家。

二:解决过程

1,增加账号及邮箱

(1)云效平台,我的账号绑定邮箱29****39@

(2)查看当前的账号及邮箱

git config user.namegit config user.email

(3)设置新的账号邮箱

git config --global user.name "su****hui"git config --global user.email "29****39@"

2,添加秘钥:

ssh-keygen -t rsa -C "29****39@"//备用ssh-keygen -t rsa -b 4096 -C "29****39@"//这个命令可以不用设置密码ssh-add ~/.ssh/id_rsaEnter passphrase (empty for no passphrase),输入:123456再次输入:123456

详细命令如下:

fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.[root@VM-0-14-centos yunding-admin]# ssh-keygen -t rsa -b 4096 -C "29****39@"Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa)://直接回车/root/.ssh/id_rsa already exists.Overwrite (y/n)? yEnter passphrase (empty for no passphrase)://输入的123456Enter same passphrase again://再次输入的123456Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:SHA256:CLLFyI7onqV2mDS9KRs3vKM1DgdUEyCYhwLM257sH1g 29****39@The key's randomart image is:+---[RSA 4096]----+|B+.+.||*+oo.||.o* +||o+ = . .||o.* .E. S ||.oo=o||.+=Xo.||.=@*+ .||.*=oo.|+----[SHA256]-----+

3,获取公钥并将其设置到云效里面

(1)获取公钥:vim /root/.ssh/id_rsa.pub

(2)拷贝内容:

ssh-rsa AAAA******c2EAAAADAQABAAACAQDHPvLYBStqVUKarcLOe9PRkJbQMaeI1W74ypk1UPYnFfuBcJ2*****wN3chTyEzO+27zgBot5oeuuHv9g8dav+qIasWqU9XIhwvpJIRHxt4V4kO6QUP0NAdaKVSN******o0Hgza/xd3kU/ytENL/nDJzdI4oJXtq5n6cZJBQO92cquvzt9Na7UvaacNRbBILQOZgQOrGO******MiVeuY1HTgrqeWOIoJtZ94b9gV2KlwQhU+PtHsefvhBelIOmXmjPsAiyWIQbsAZFbxtQd9h******X6FFGsjFyvyD/iGXELYsPmjGD6L9qJgXrjcPS7+1Zyo4EWCuZuNNAuhPpoRubjU62huq/pm******5o9s9s8auu1kUS70pBh1hBxn4OcDNG+iFI+n8ZGv5Ot+rs1PGs4jo58AOS2J7eibXHlTuy0******CHKFljmT01gvdtdQmwueXh4nBYTapMvryOtcj33zEPLEBSB56xlWxZMUajpZoMZaDfVEbNvow+RcME7qg25RG0zhwnqTqGJPfAsrRm1SvhpQQPcpQlbe21NwqsmmTI3mJOoJYRtluspHiiYaDyf9+P7ieLjnx/DyBTUzqvDtz8XAK2tC6cT4Ph7RxiOrIQrXUuxUcdrQkmE4+dEBSySgTGlrrSFThp00nLjBwHh5vD/wfWinZ92WfMuUpQ== 29****39@

(3)云效-个人设置-SSH公钥-添加SSH公钥-保存

其中:作用范围为全部

4,宝塔终端 解除密码

命令:ssh-keygen -p

输入密码:直接回车

输入旧密码:123456

确认新密码:回车

再次确认新密码:回车

三:解决截图

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。