1

When running git push -u origin master, I receive an error message unexpectedly. I have tried pushing to Github and also Gitlab. I get the same error.

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

Error report

It is okay when I try to run git add . and git commit -m "commit image".

The data I am committing is separate images. There are more than 41,000 image files.

phd
  • 82,685
  • 13
  • 120
  • 165
Mochni
  • 13
  • 8
  • Possible duplicate of [Git fails when pushing commit to github](https://stackoverflow.com/questions/2702731/git-fails-when-pushing-commit-to-github) – phd Sep 19 '19 at 18:28
  • https://stackoverflow.com/search?q=%5Bgit%5D+error%3A+unable+to+rewind+rpc+post+data+try+increasing+http.postBuffer – phd Sep 19 '19 at 18:28

1 Answers1

1

Your error message states that we should try increasing http.postBuffer.

The git documentation for http.postBuffer tells us that the default maximum is 1 MiB.

Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

You're right to note that your images are numerous. Because you have 41627 new objects to push, the total size of the files you're writing is 2.25 GiB. This is far larger than the 1 MiB limit.

Increasing http.postBuffer

You could try increasing the buffer size, as the error message states.

You can increase this to 3 GiB by setting git config http.postBuffer 3221225472.

I would recommend against doing this, because 3 GiB is much, much larger than the 1 MiB default.

Git Large File Storage

Storing large non-text-based files is a common problem with git, and a solution which exists is Git Large File Storage. It replaces your images in Git with pointers to files hosted on GitHub.com.

It offers the "same access controls and permissions" as when working with a remote host like GitHub.

Keep the same access controls and permissions for large files as the rest of your Git repository when working with a remote host like GitHub.

Generally, git isn't made for versioning binary files. It's best for tracking text-based content.

Robin James Kerrison
  • 1,727
  • 1
  • 15
  • 26
  • `$ 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` – Mochni Sep 19 '19 at 23:27