【问题标题】:Git push fails for large number of commits大量提交的 Git 推送失败
【发布时间】:2021-10-26 21:11:49
【问题描述】:

类似于:

Github remote push pack size exceeded

失败信息:

Pushing efb55fab0352e4fff42129d00b642e908e9d09c1...
Counting objects: 617706, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (368204/368204), done.
Writing objects:  36% (222375/617706), 1.79 GiB | 278.60 MiB/s     

remote: fatal: pack exceeds maximum allowed size
error: RPC failed; curl 55 Failed sending data to the peer
fatal: The remote end hung up unexpectedly
Writing objects: 100% (617706/617706), 4.37 GiB | 185.36 MiB/s, done.
Total 617706 (delta 218614), reused 617467 (delta 218375)
fatal: The remote end hung up unexpectedly
Everything up-to-date
Counting objects: 617709, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (368206/368206), done.
Writing objects:  36% (222376/617709), 1.83 GiB | 392.11 MiB/s   

上下文:

  1. 处理奇异果的叉子 (https://github.com/kiwibrowser/src)

  2. 从答案https://stackoverflow.com/a/51468389/1079483创建了一个脚本

  3. 为方便起见,在 url 中添加了令牌:

    $ git remote set-url origin https://:@github.com/path/to/repo.git

  4. 跑推;几个小时后抛出上述错误?

【问题讨论】:

  • remote: fatal: pack exceeds maximum allowed size 是关键线:GitHub 对您可以执行的推送设置了限制(以及对单个文件大小和其他限制的限制)。当你得到这个时,你唯一的选择就是把你的推动分成更小的部分,一边推动一边推动。

标签: git github push large-files git-push


【解决方案1】:

在 GitHub.com 上,大小限制为 100MB https://docs.github.com/en/github/managing-large-files/working-with-large-files/conditions-for-large-files

如果您有 Github Enterprise Server,您可以更改大小限制,前提是您有权这样做。 https://docs.github.com/en/enterprise-server@3.1/github/managing-large-files/working-with-large-files/conditions-for-large-files

如果其中一些文件是二进制文件,你可以使用 Git LFS 吗?

【讨论】:

    猜你喜欢
    • 2011-02-11
    • 2014-04-17
    • 1970-01-01
    • 2019-07-12
    • 2013-12-17
    • 2015-04-17
    • 1970-01-01
    • 1970-01-01
    • 2014-02-16
    相关资源
    最近更新 更多