IDEA从GitHub 同步项目异常集合小记(踩坑不断)

本文档详细解析了在使用GitHub下载项目时常见的错误,如RPC失败、SSL验证问题和早期EOF错误,并提供了具体的解决方案,包括如何配置Git以绕过SSL证书验证,以及调整Git配置来解决数据传输问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GitHub 下载项目错误集合小记

git clone错误之"error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054"

当我们使用git clone指令从github 上download其它优秀的代码时,如果报如下错误

RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno
10054 the remote end hung up unexpectedly early EOF index-pack failed

这是因为服务器的SSL证书没有经过第三方机构的签署,所以才报错。解决方案如下:
第一步,克隆远程仓库时,用env命令设置GIT_SSL_NO_VERIFY环境变量为”ture”,并同时调用正常的git clone命令。完整的命令如下:

env GIT_SSL_NO_VERIFY=true git clone https://<host_name/git/project.git

第二步,在克隆完毕的仓库中将http.sslVerify设置为”false”。完整的命令如下:

git config http.sslVerify "false"

备注:以上方法应该是Git处理可信任的SSL临时证书很好的方法,第一步使用env命令保证了忽略证书错误是单次行为,不会成为默认的设置。第二次,则把忽略证书错误的设置限定在特定的仓库,避免扩大该设置的适用范围而引起的潜在安全风险。

-----------------------------------------------------------------------------------分割线-----------------------------------------------------------------------------

git报错:early EOF The remote end hung up unexpectedly index-pack failed RPC failed

在idea同步项目,结果在 clone 的过程中遇到了下面的错误。
$ git clone -v https://github.com/luqiang111/xmall.git
Cloning into ‘butterfly025’…
remote: Counting objects: 4846, done.
remote: Compressing objects: 100% (3256/3256), done.
fatal: read error: Invalid argument, 255.05 MiB | 1.35 MiB/s
fatal: early EOF
fatal: index-pack failed

First, turn off compression:

git config --global core.compression 0

Next, let’s do a partial clone to truncate the amount of info coming down:

git clone --depth 1 <repo_URI>

When that works, go into the new directory and retrieve the rest of the clone:

git fetch --unshallow 

or, alternately,

git fetch --depth=2147483647

Now, do a regular pull:

git pull --all

I think there is a glitch with msysgit in the 1.8.x versions that exacerbates these symptoms, so another option is to try with an earlier version of git (<= 1.8.3, I think).

参考:https://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed

-----------------------------------------------------------------------------------分割线-----------------------------------------------------------------------------

idea git clone 遇到"unable to access :error setting certificate verify locations"问题

解决办法:进入git-bash窗口,输入命令: git config --system http.sslverify
false,即可解决问题。

参考:https://stackoverflow.com/questions/27283229/clone-failed-unable-to-access-https-failed-connect-to-github443-no-er

※中间还升级过一次Git,不知道会不会有关系;
直接贴命令,比较简单
打开Git Bash,输入

git update-git-for-windows
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值