Git 遇到了 early EOF index-pack failed 問題「建議收藏」

 

error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
error: Cannot fetch platform/external/mesa3d from https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/external/mesa3d

 

git config --global http.postBuffer 1048576000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
git config --global core.compression 9

查看設的值:

git config --list = git config -l

 

pm@pm:~$ git config --list
user.email=11597475@qq.com
color.ui=auto
http.postbuffer=1048576000
http.lowspeedlimit=0
http.lowspeedtime=999999
core.compression=9
pm@pm:~$ git config -l
user.email=11597475@qq.com
color.ui=auto
http.postbuffer=1048576000
http.lowspeedlimit=0
http.lowspeedtime=999999
core.compression=9
pm@pm:~$ 

 

 

 

Git 遇到了 early EOF index-pack failed 問題「建議收藏」

大家好,又見面了,我是全棧君。

今天想 clone 一下 boost 在 github 的 repo,結果在 clone 的過程中遇到了下面的錯誤。我原本以爲是網絡原因,今天學校網速廢成渣了,很多同學都去網吧擼去了,所以就 retry 了一次。還是出現了下面的錯誤,然後就不得不 google 去了。

$ git clone https://github.com/boostorg/boost.git
Cloning into 'boost'...
remote: Counting objects: 183543, done.
remote: Compressing objects: 100% (69361/69361), done.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

後來 google 到的參考如下:

特別是第一篇(第一個QA),應該跟我的情況最爲符合,不過我嘗試了第二個 QA 中Voket 的回答給出的解決方案。因爲我在  Windows 下的  Git 作的這個死。在這裏就簡單記錄一下這個解決方案。

# 爲 git 添加配置項,通過下面的命令可以簡單完成
# 在這之前可以執行 git config -l 命令看看已有配置項有哪些
git config --add core.compression -1

上面是通過命令來完成的,很方便,當然可以直接修改 .gitconfig 文件(在用戶目錄下),如果你願意的話。部分內容如下:

[user]
    name = Ggicci
    email = ...
[core]
    compression = -1

在 [core] 這個 section 裏面添加 compression 屬性即可。至於它的取值可以參考 Git Config Manpage,這個頁面你可以通過man git config(linux) 或者 git config --help(windows)來查看本地版本。

core.compression An integer -1..9, indicating a default compression level. -1 is the zlib default. 0 means no compression, and 1..9 are various speed/size tradeoffs, 9 being slowest. If set, this provides a default to other compression variables, such as core.loosecompression and pack.compression. – From Git Manpage

compression 是壓縮的意思,從 clone 的終端輸出就知道,服務器會壓縮目標文件,然後傳輸到客戶端,客戶端再解壓。取值爲 [-1, 9],-1 以 zlib 爲默認壓縮庫,0 表示不進行壓縮,1..9 是壓縮速度與最終獲得文件大小的不同程度的權衡,數字越大,壓縮越慢,當然得到的文件會越小。

這之後再嘗試了一次 clone,works perfectly :)

$ git clone https://github.com/boostorg/boost.git
Cloning into 'boost'...
remote: Counting objects: 183543, done.
remote: Compressing objects: 100% (69361/69361), done.
remote: Total 183543 (delta 113990), reused 183372 (delta 113844)
Receiving objects: 100% (183543/183543), 67.89 MiB | 162.00 KiB/s, don
e.
Resolving deltas: 100% (113990/113990), done.
Checking connectivity... done.
======================補充===============================
git clone提示:

fatal: The remote end hung up unexpectedlReceiviny00 KiB/s
fatal: early EOF(328/529), 13.43 MiB | 29.00 KiB/s

fatal: index-pack failed


解決方法:

運行:git config ––global http.postBuffer 1048576000 即可。(親測可行)

如果不行,試試:

git config --global core.compression 9

原文:https://blog.csdn.net/baidu_22561035/article/details/79650412

發佈者:全棧程序員棧長,轉載請註明出處:https://javaforall.cn/112285.html原文鏈接:https://javaforall.cn

 

https://cloud.tencent.com/developer/article/1940598

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章