After getting a legacy project into Git version control on my local machine today, I was ready to push up to the repository created in our on-site hosted Git server.
But, I kept getting the following error message:
error: RPC failed; result=56, HTTP code = 0 fatal: The remote end hung up unexpectedly
So, I thought – maybe its just poshgit playing up? Lets check in WebStorm:
Hmmm… to the search engine!
To get Git in use at my current contract, I installed GitBlit on the available development server (would have preferred to use Github or Stash, but it had to be on-site hosted only and have very little cost implications).
I came across a GitBlit issue raised by a user getting the same error – GitBlit Issue 162.
This advises to increase the http.postBuffer value in the Git config:
git config http.postBuffer 524288000
Which got the push working perfectly:
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. — https://www.kernel.org/pub/software/scm/git/docs/git-config.html