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?
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.
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.
Resolution. Increase the Git buffer size to the largest individual file size of your repo: git config --global http. postBuffer 157286400.
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.
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. ...
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.
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.
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.
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
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With