天天看点

git秘钥问题解析及gitlab配置(Please make sure you have the correct access rights and the repository exists)

前端开发从进项目,代码有几周没提交了,公司管理员给分配了gitlab的权限,就帮他弄下,结果一直报以下错误:

Please make sure you have the correct access rights and the repository exists.

git clone [email protected]:ruanjianlaowang/web.git c:\Users\软件老王\Desktop\web --progress Host key verification failed. fatal: Could not read from remote repository.

从报错信息看,要么远程仓库地址不对,要么是没有权限,重新生成秘钥了和检查地址了好多次,就是不行,弄的有点怀疑人生了,最后突然发现问题所在,记录下,希望能帮到朋友们。

地址:

下载后exe文件,直接next、next到最后一步,全部默认安装就好了。

git秘钥问题解析及gitlab配置(Please make sure you have the correct access rights and the repository exists)

以ssh-rsa 开头,直接全部复制粘贴:

git秘钥问题解析及gitlab配置(Please make sure you have the correct access rights and the repository exists)

登陆账户右上角的设置->ssh秘钥->复制公钥到空白框中添加即可。

git秘钥问题解析及gitlab配置(Please make sure you have the correct access rights and the repository exists)

项目主要是在idea中使用的,以下这一步刚开始我们没做,不过在找问题的有朋友提到可能是这个问题,也随便做了做,不过以前记得是没有这样做的。

为什么很简答的操作,反复确认了还是报:Please make sure you have the correct access rights and the repository exists呢?

问题出在了这一步了,Enter passphrase,这里输入了账户密码,导致在idea中一直报没有权限,但是idea却没有提示要录入密码,后面通过git命令拉取的时候,弹出让输入密码,输入居然好了,才发现这里要直接回车,不能输入密码,否则idea中就无法拉取远程仓库的代码。

Enter passphrase要直接回车,不能录入密码!

公众号:「软件老王」本文版权归作者软件老王所有,转载需注明作者、超链接,否则保留追究法律责任的权利。

git秘钥问题解析及gitlab配置(Please make sure you have the correct access rights and the repository exists)