OpenHarmony开发者论坛

标题: 一种从gitee拉取代码遇到“the remote end hung up unexpectedly” 错误的处理办法 [打印本页]

作者: lakewater    时间: 2024-6-25 08:38
标题: 一种从gitee拉取代码遇到“the remote end hung up unexpectedly” 错误的处理办法
使用repo方式获取OpenHarmonary的源代码,经常遇到类似下面的错误:



fatal: the remote end hung up unexpectedly MiB | 520.00 KiB/s
fatal: early EOF
fatal: index-pack failed



从网上查找资料,说是可以修改http postbuffer,或者设置拉取的仓库代码depth,但是由于网络等原因一直不能解决。

现在找到了一个简单的办法,就是自动跳过失败的仓库,然后手动clone失败的仓库,结果测试,编译可以成功,下面是基本步骤:


1. 修改.repo目录中的xml配置文件,把失败仓库先注释掉

例如,third_party_typescript仓库一直拉取失败

编辑 <Harmony root folder>/.repo/manifests/ohos/ohos.xml 文件
注释掉下面行,则此仓库就不会被pull
<project name="third_party_typescript" path="third_party/typescript" groups="default,ohos:standard,ohos:system"/>

2. 使用repo sync -c重新拉取其它代码,跳过失败的仓库
3. 使用git clone命令把失败的仓库直接克隆到指定目录下,如下命令:


git clone https://gitee.com/openharmony/third_party_typescript.git typescript --depth 1






欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5