git clone项目 权限 问题


Host key verification failed.
fatal: Could not read from remote repository.

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

在 git clone 项目时,提示没有权限,不能clone,有以下几种情况

1、可能是 之前电脑使用过git ,现在和之前不是同一个账号,要重置。

git config --system --unset credential.helper

输入上面命令后,再次git clone时,会让我们重新输入 username 和 password.

    注:设置 修改 本地 git 账号和密码:

$ git config --global user.name "yourname"

$ git config --global user.email "youremail"

2、设置后 重新 git clone 发现还是不行。

 有可能是公钥出现问题,重新设置用户名和密码,生成公钥(这里要记得删除之前的公钥)

$ git config --global user.name "yourname"

$ git config --global user.email "youremail"

 删除 .ssh 文件夹

路径:

 

 git 输入命令

$ ssh-keygen -t rsa -C "youremail"(设置的邮箱地址)

 

 

 

 然后会生成 .ssh文件夹。

打开 .ssh文件下的id_rsa.pub 全部复制,进入git ->setting ->ssh key 新增 ssh key即可。 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM