Git系列:常见报错处理
本文小结Git使用过程中遇到的常见报错处理。
Git系列:常见报错处理
- 报错:fatal: could not read from remote repository, please make sure you have the correct access rights
报错:fatal: could not read from remote repository, please make sure you have the correct access rights
-
根因:没有在Github上配置git本地秘钥
-
解决方案
-
确保本地git账号设置ok
- 配置指令如下
git config –global user.name "xxxxx"
git config –global user.email "xxx@xx.xxx"
- 查看是否配置成功,用命令:
git config --global --list
- 查看本地秘钥是否与Github账户的公钥配置一致
- 生成秘钥
- ssh-keygen -t rsa -C “上面的邮箱”
- 注:执行上面命令后,连续回车3次
- 打印
-cd ~/.ssh
,进入ssh目录
-cat id_rsa.pub
,打印ssh公钥
- 生成秘钥
- 再次尝试拉取代码
- git clone ssh@…
- 配置指令如下
-
详细步骤见资料:link