Git 遇到了 early EOF index-pack failed 问题

Git 遇到了 early EOF index-pack failed 问题 

今天想 clone 一下 boost 在 github 的 repo,结果在 clone 的过程当中遇到了下面的错误。我本来觉得是网络缘由,今天学校网速废成渣了,不少同窗都去网吧撸去了,因此就 retry 了一次。仍是出现了下面的错误,而后就不得不 google 去了。html

$ 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 到的参考以下:linux

特别是第一篇(第一个QA),应该跟个人状况最为符合,不过我尝试了第二个 QA 中Voket 的回答给出的解决方案。由于我在 WindowsWindows 下的 GitGit 做的这个死。在这里就简单记录一下这个解决方案。git

# 为 git 添加配置项,经过下面的命令能够简单完成
# 在这以前能够执行 git config -l 命令看看已有配置项有哪些
git config --add core.compression -1

上面是经过命令来完成的,很方便,固然能够直接修改 .gitconfig 文件(在用户目录下),若是你愿意的话。部份内容以下:github

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

在 [core] 这个 section 里面添加 compression 属性便可。至于它的取值能够参考 Git Config Manpage,这个页面你能够经过man git config(linux) 或者 git config --help(windows)来查看本地版本。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 :)ide

$ 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.
相关文章
相关标签/搜索