【问题标题】:I get stuck with git bash fatal error report我被 git bash 致命错误报告卡住了
【发布时间】:2020-01-20 18:43:54
【问题描述】:

在运行git push -u origin master 时,我意外收到一条错误消息。我曾尝试推送到 Github 和 Gitlab。我得到同样的错误。

error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
fatal: the remote end hung up unexpectedly

当我尝试运行git add .git commit -m "commit image" 时没问题。

我提交的数据是单独的图像。图像文件超过 41,000 个。

【问题讨论】:

标签: git git-push


【解决方案1】:

您的错误消息表明我们应该try increasing http.postBuffer

git documentation for http.postBuffer 告诉我们默认最大值为 1 MiB。

将数据发送到远程系统时,智能 HTTP 传输使用的缓冲区的最大大小(以字节为单位)。对于大于这个缓冲区大小的请求,使用 HTTP/1.1 和 Transfer-Encoding: chunked 来避免在本地创建海量的包文件。 默认为 1 MiB,足以满足大多数请求。

您说得对,您的图片数量众多。因为您有 41627 个新对象要推送,所以您正在写入的文件的总大小为 2.25 GiB。这远远大于 1 MiB 的限制。

增加http.postBuffer

您可以尝试增加缓冲区大小,如错误消息所述。

您可以通过设置 git config http.postBuffer 3221225472 将其增加到 3 GiB。

我建议不要这样做,因为 3 GiB 比默认的 1 MiB 大得多。

Git 大文件存储

存储大型非基于文本的文件是 git 的常见问题,现有的解决方案是 Git Large File Storage。它用指向托管在 GitHub.com 上的文件的指针替换您在 Git 中的图像。

它提供与使用 GitHub 等远程主机时“相同的访问控制和权限”。

在使用 GitHub 等远程主机时,对大文件保持与 Git 存储库的其余部分相同的访问控制和权限。

通常,git 不是为二进制文件版本控制而设计的。最适合跟踪基于文本的内容。

【讨论】:

  • $ git push -u origin master Enumerating objects: 41628, done. Counting objects: 100% (41628/41628), done. Delta compression using up to 4 threads Compressing objects: 100% (41626/41626), done. Writing objects: 100% (41627/41627), 2.25 GiB | 5.78 MiB/s, done. Total 41627 (delta 0), reused 41627 (delta 0) error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 fatal: the remote end hung up unexpectedly fatal: the remote end hung up unexpectedly Everything up-to-date
猜你喜欢
  • 2015-01-16
  • 2018-05-25
  • 1970-01-01
  • 2023-02-09
  • 2018-08-05
  • 2016-11-06
  • 1970-01-01
  • 2012-10-14
  • 1970-01-01
相关资源
最近更新 更多