-2

I tried git config --global http.postBuffer 157286400 but nothing happened. I get this error

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (213/213), 8.64 GiB | 9.31 MiB/s, done.
Total 213 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
UpAndAdam
  • 4,515
  • 3
  • 28
  • 46
  • 2
    explain what you are trying to accomplish and command is yielding the error please (in the question body not in a comment response ) – UpAndAdam Aug 04 '23 at 14:36
  • Looks like a very large amount of day was being transferred and remote repo or proxy timed out. Increasing the `http.postBuffer` might have helped for what you posted yet it would still require the proxies and repo receiving to be happy with the chunk sizes your sending. In many cases there unhappiness is not deliberate, just the result of the default and somewhat unattended configuration they have. – Alan Carlyle Aug 08 '23 at 03:25

2 Answers2

1

GitHub doesn't permit pushes larger than 2 GiB, and you're trying to push 8.64 GiB. This is too large, and you need to push in smaller chunks.

If your data is entirely in one commit, then it's too big, and you need to split it up into multiple commits.

You can use something like this, adjusting the constants (30000, origin, and main) as appropriate for your circumstance.

git rev-list --reverse --all --not --remotes=origin | ruby -ne 'x ||=0; x += 1; print $_ if x % 30000 == 0;' | xargs -I{} echo git push origin +{}:refs/heads/temp
git push origin +main :refs/heads/temp

That will push the data incrementally to a branch called temp, and then finally push the final value to main, deleting temp. If you have only a handful of commits, then you may want to change 30000 to something like 2 or even 1. This can also be done easily with Perl instead of Ruby, but that as left as an exercise for the reader.

Note that http.postBuffer should generally not be used, according to the Git FAQ. The only reason this would have any functional benefit whatever is if GitHub or a proxy server between you and GitHub didn't properly speak HTTP/1.1 by not understanding chunked transfer encoding. GitHub certainly does not have that problem, and hopefully you're not using such a proxy (because lots of things would be very broken), so all you're doing by setting that is wasting lots of memory on every push. People who are telling you it fixes push problems are, unfortunately, generally simply wrong, and tend to think it works mostly because their particular push problem is intermittent.

bk2204
  • 64,793
  • 6
  • 84
  • 100
0

see comment https://stackoverflow.com/a/76498139/17138871

Your error snippet indicates your commit size is 8.64 GiB. You may need to break down the commit size into smaller chunks

You can also find Github's storage and bandwidth limits, assuming you're using Github here:

Asad
  • 106
  • 1
  • 11