25

I am new to GIT. I am using Git version 1.7.9.5.

I am working on project hosted on github. While pushing and pulling the code from github sometime it works fine and some time it gives me error.

error: RPC failed; result=22, HTTP code = 408

fatal: The remote end hung up unexpectedly

I don't what is going wrong. If anyone can suggest me something what could possibly be the issue.

Community
  • 1
  • 1
Raj
  • 271
  • 1
  • 3
  • 7
  • 1
    Try doing the same from another IP.. – gravetii Mar 13 '14 at 04:59
  • @gravetii i am having only network available in office. By trying with other IP what is means. Is it a internet issue. I am using Ubuntu 12.04 LTS – Raj Mar 13 '14 at 05:01
  • 1
    `fatal: The remote end hung up unexpectedly` errors often occur because of network issues unrelated to git. The fact that you say "sometimes push/pull work and sometimes they don't" would support that theory. –  Mar 13 '14 at 19:09
  • @Cupcake but when i get the error at the same time i check for internet and that seems to work fine. Is there anything i can do to bypass this issue like increase the pull timeout or something like that. – Raj Mar 18 '14 at 06:49

10 Answers10

32

The problem is due to git/https buffer settings. In order to solve it run this below command:-

git config http.postBuffer 524288000

And try git push again

shiminsh
  • 1,224
  • 15
  • 14
  • Still I am facing the same issue. – Ram Thota Aug 07 '19 at 13:29
  • 1
    @RamThota can you check git version. And can you check if it's the same error or is it different? – shiminsh Aug 08 '19 at 07:52
  • git version 2.19.1.windows.1 – Ram Thota Sep 05 '19 at 13:50
  • git version 2.31.1.windows.1 – saber tabatabaee yazdi Mar 31 '23 at 06:42
  • try to use the command line "git push" I had problems with vsc, but not with command line. Even after changing this buffer and lowspeed limit – Bhikkhu Subhuti Jun 08 '23 at 16:25
  • Note that [the Git FAQ](https://git-scm.com/docs/gitfaq#http-postbuffer) indicates that this option isn't a general solution for push problems, and will only work if your network or proxy is very broken. If this happens to work, then that usually means that your problem is actually intermittent, and trying again just happens to work. It does, however, cause a large amount of memory to be allocated for every push. – bk2204 Sep 01 '23 at 19:06
11
  1. Increase the buffer size used by the http transport: documentation

    git config http.postBuffer <Size_in_Bytes>

    git config http.postBuffer 500000000

  2. Increase the timeout. Git aborts a transfer if the transfer speed is less than http.lowSpeedLimit for http.lowSpeedTime refer: documentation

    git config http.lowSpeedTime 600

  3. Retry several times push operation, because temporary hiccup in the network connection may cause this issue.

OshiniRB
  • 578
  • 1
  • 7
  • 21
  • the http.postBuffer one worked for me on a Win10 machine, however check the doc since it says "Raising this is not, in general, an effective solution for most push problems, but can increase memory consumption significantly since the entire buffer is allocated even for small pushes." - you might want to set it back to 1MB later on – George Birbilis May 03 '23 at 15:21
2

I had a file that is larger than 100 MB (Github's limit) and this caused this issue for me. Check your committed files and see if there is anything larger than 100 MB.

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
Jack Chen
  • 39
  • 5
2

Changing network solved my problem.

0

I, too, got this recently, and @shiminsh's solution "Worked for me", gazing at the documentation {well looking at the output from man git-config} we have:

http.postBuffer

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.

I do wonder, though, if a limit of around 0.5 GBytes might be a bit much the other way...! I am using Git version 1.7.10.4 on a Debian Wheezy Linux platform but I doubt that is that relevant to this issue. What this setting is basically saying is "for pretty much anything you send to the remote system use HTTP/1.1 and Transfer-Encoding: Chunked and don't worry about creating a massive pack file locally".

SlySven
  • 326
  • 3
  • 15
0

In the first step, run this command:

git config http.postBuffer 524288000

Then run this command:

git config --show-origin --get-all http.postBuffer

Then:

git config —-global --unset http.postBuffer
git config —-local --unset http.postBuffer

At the end:

git reset --soft HEAD~1
0

You can follow these steps!

Increase git buffer

git config http.postBuffer 524288000

Change your terminal

If you use vscode terminal you can switch to the terminal of your PC. Like Powershell on windows.

Check file size

Github's default max limit is 100MB so check your files size.

Check your internet connection

Try to switch to another network and try

-1

Try to push / pull from Github Desktop. it solved my probelm.

Nath Ryuzaki
  • 11
  • 1
  • 4
-1

Delete the repository on GitHub.
Remove the remote address on your local machine (i.e., git remote rm origin).
Re-create the repo on GitHub.
Add remote to local git and proceed as normal.

Strangely as it is with many things with computers, this happened to work for me.

-2

Try a VPN and connect to a server in the US, it worked for me

Kabindas
  • 802
  • 9
  • 6