Taksh04
Taksh04

Reputation: 41

error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

I did "git add ." and "git commit" on a project and every time I push this, its unsuccessful with this message being displayed:

Enumerating objects: 64387, done. Counting objects: 100% (64387/64387), done. Delta compression using up to 12 threads Compressing objects: 100% (49041/49041), done. error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 send-pack: unexpected disconnect while reading sideband packet Writing objects: 100% (64387/64387), 3.06 GiB | 17.57 MiB/s, done. Total 64387 (delta 13950), reused 64143 (delta 13706), pack-reused 0 fatal: the remote end hung up unexpectedly Everything up-to-date

Writing objects always gets stuck at 92% and then RPC error is displayed.

I have tried "git config --global http.postBuffer XXX" with XXX values upto 2 GB. Still doesn't work. Please help me solve this

Upvotes: 3

Views: 6525

Answers (1)

bk2204
bk2204

Reputation: 76944

GitHub has a hard limit on the size of pushes that's 2 GiB. Any push larger than this will be rejected.

In your case, the size of what you're pushing is over 3 GiB. If this is all one commit, then the commit is too large, and you'll need to split it into smaller ones. Note that you cannot do this by simply creating new commits on top of the existing one, since the entire history you're pushing matters.

If there are multiple commits, you need to push them incrementally. This answer provides an example of how you might do that. Note that you'll need to adjust the number of commits in that list to be smaller if you have fewer, larger commits.

According to the Git FAQ, the http.postBuffer option is only needed if you have a server or proxy that is extremely ancient or extremely broken, and GitHub is neither. All setting it serves to do is waste memory in the vast majority of cases, so you should unset it.

Upvotes: 3

Related Questions