1、git clone 错误如下:
正克隆到 '***'...
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Please make sure you have the correct access right
2、解决步骤:
a、服务器 ~/.ssh/id_rsa.pub文件内容拷贝到git账号setting的SSH Keys里面
b、如果上述步骤提示:公钥重复,此时表示该服务器公钥已经被添加到别的账号里面,执行下面步骤
c、在服务器重新生成自己的公钥:
ssh-keygen -t rsa -f pangu_ssh -C "***@***”
mv pangu_ssh ~/.ssh
mv pangu_ssh.pub ~/.ssh
eval `ssh-agent` && ssh-add ~/.ssh/pangu_ssh
d、把新生成的pangu_ssh.pub内容拷贝到git项目的setting里面
此时,应该是可以正常拉取项目了。
e、如果后续再出现上述错误,直接执行
eval `ssh-agent` && ssh-add ~/.ssh/pangu_ssh
该指令即可。
本文解决了一个常见的GitClone错误,详细步骤包括检查SSH公钥、重新生成及添加公钥至GitLab账户,确保服务器能正确访问远程仓库。

1568

被折叠的 条评论
为什么被折叠?



