Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git, fatal: The remote end hung up unexpectedly

Tags:

git

github

When I tried to run

git push origin master --force

I just got

Counting objects: 2649, done.
Delta compression uses up to 2 threads.
Compressing objects: 100% (1280/1280), done.
error: RPC failed; result=22, HTTP code = 413 | 116 KiB/s   
fatal: The remote end hung up unexpectedly
Writing objects: 100% (2504/2504), 449.61 MiB | 4.19 MiB/s, done.
Total 2504 (delta 1309), reused 2242 (delta 1216)
fatal: The remote end hung up unexpectedly
Everything up-to-date

Is it something to do with not being secure? I tried creating a public key as the answer for Fatal: The remote end hung up unexpectedly and rerunning it, but it still doesn't work. Am I not actually using the key? If so, how do I use it?

like image 265
DanielLC Avatar asked Mar 06 '13 06:03

DanielLC


People also ask

How do you solve fatal the remote end hung up unexpectedly?

Solution. To solve the issue, change the settings of your buffer so that you have enough space available. You can increase the buffer value up to 2000000000.

What is http postBuffer in git?

From the git config man page, http. postBuffer is about: 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.

How do you increase git buffer size to the largest individual file size of your repo?

Resolution. Increase the Git buffer size to the largest individual file size of your repo: git config --global http. postBuffer 157286400.

How to fix remote end hung up unexpectedly error in Git?

In conclusion, the fatal: The remote end hung up unexpectedly error occurs when we exceed the default post size when pushing or pulling. To remedy this, you will have to increase the buffer size by tweaking your Git configuration file, as shown above. DelftStack articles are written by software geeks like you.

What are the common causes of Git push failure?

Git Push Fails - fatal: The remote end hung up unexpectedly 1 Symptoms. Delta compression using up to 16 threads. ... 2 Cause. The "Smart HTTP" protocol in Git uses "Transfer-Encoding: chunked" in POST requests when it contains packed objects greater than 1MB in size. 3 Workaround. ... 4 Resolution. ...

Why does Git clone fail after 1 GB?

Typically this is caused by a network setting, firewall, VPN client, or anti-virus that is terminating the connection before all data has been transferred. Cause #2 There is no error code and git debug log shows that Nginx is configured as reverse proxy. Git clone fails after 1 GB. Workaround for Cause #1: Switch to using SSH to perform the clone.

Why does Nginx keep disconnecting from Git?

Typically this is caused by a network setting, firewall, VPN client, or anti-virus that is terminating the connection before all data has been transferred. Cause #2 There is no error code and git debug log shows that Nginx is configured as reverse proxy.


4 Answers

This is due to git/https buffer settings.

Run this (taken from Git fails when pushing commit to github):

git config http.postBuffer 524288000

Then, run your original command again.

like image 108
Roman M Avatar answered Oct 18 '22 23:10

Roman M


Cause: The default file post size for Git has been exceeded.

Solution: Navigate to repo. Run the following command to increase the buffer to 500MB after navigating to the repository:

git config http.postBuffer 524288000
like image 30
Chinu Avatar answered Oct 19 '22 00:10

Chinu


This looks similar to How do I get github to default to ssh and not https for new repositories. Probably it's worth trying to switch from http protocol to ssh:

$ git remote add origin [email protected]:username/project.git
like image 117
Vitalliuss Avatar answered Oct 18 '22 22:10

Vitalliuss


You might get an error like this

error: could not lock config file .git/config: No such file or directory

that is because you don't have a local .git/config file You can get it working by this command:

git config --global http.postBuffer 524288000
like image 55
niksmac Avatar answered Oct 18 '22 23:10

niksmac