Git致命:数据包在偏移X处有错误的对象:膨胀返回-5 [英] Git fatal: pack has bad object at offset X: inflate returned -5

查看:918
本文介绍了Git致命:数据包在偏移X处有错误的对象:膨胀返回-5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git给了我一个可爱的圣诞节礼物...我正在尝试git push一堆提交,例如6 GB.而且我收到以下错误消息:

Git has given me a lovely christmas gift... I'm trying to git push a bunch of commits, like 6 GB. And I'm getting the following error message:

-Counting objects: 525, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (474/474), done.
fatal: pack has bad object at offset 3453162391: inflate returned -5
error: pack-objects died of signal 13
error: failed to push some refs to ....git

这是什么意思,它如何解决?从Google可以看出,这与我要推送的内容大小有关.

What does this mean and how is it fixed? From Google I can tell it has something to do with the size of what I'm trying to push.

这是在写作时发生的.

推荐答案

根据您的偏移量,您似乎正在尝试推动一些非常大的对象(偏移量3453162391 =〜> = 3GB),因此 zlib 未能膨胀/压缩对象,因为输出缓冲区中没有足够的空间(错误:Z_BUF_ERROR).

Based on your offset, it looks like you're trying to push some really big object (offset 3453162391 =~ >= 3GB), so zlib failed on inflating/compressing the object since there was not enough room in the output buffer (error: Z_BUF_ERROR).

这可能与暂时的内存不足或某些缓冲区限制有关.基本上,它尝试使用可用的输出来处理尽可能多的输入,否则它返回Z_BUF_ERROR.请参阅: zlib膨胀会返回缓冲区错误.

This could be related to temporary lack of memory, or some buffer limits. Basically it's trying to process as much input as possible using the available output, otherwise it returns Z_BUF_ERROR. See: zlib inflate returning a buffer error.

您应该重试以查看是否可以重现该问题.

You should re-try to see if the problem can be reproduced.

如果问题是可重复的,请尝试:

If the issue is repeatable, then try to:

  • 避免将大文件推送到git存储库中,Git旨在跟踪源代码文件,而不是非常大的文件(如6GB),

  • avoid pushing large files into git repository, Git was designed to track the source code files, not very large files (like 6GB),

增加客户端http.postBuffer上git消息的大小,例如

increase git message size on your client http.postBuffer, e.g.

git config http.postBuffer 134217728 # =~ 128MB

  • 使用一些可以忽略较大斑点的替代客户端,例如 bfg ,例如

  • use some alternative client which can ignore larger blobs, such as bfg, e.g.

    java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git
    

  • 删除引起问题的对象( git gc ?).

  • remove the object which is causing the issue (git gc?).

    其他潜在问题可能包括:

    Other potential issues could include:

    • a git bug, since according to zlib manual, the command shouldn't abort on Z_BUF_ERROR,
    • old kernel bug (<= 2.6.32-rc4).

    有关更多信息,请查看以下文章:包装有不良物品",当推向遥控器时.

    For further readings, check this post: "pack has bad object" when pushing to remote.

    如果您想使用Git处理大型文件,请检查以下内容:

    If you'd like to work with large files with Git, check the followings:

    • GitHub: Announcing Git Large File Storage (LFS) & Git Large File Storage (LFS)
    • Git with large files

    这篇关于Git致命:数据包在偏移X处有错误的对象:膨胀返回-5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆