stupid issue with Github going on right now. I have a decent amount of changes (~120MB in size), when I attempt to push, this is what happens:
error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
I've already done
git config http.postBuffer 524288000
, so that doesn't seem to be the issue. What could it be?
If you are facing this issue while pushing changes in big size then run below command in terminal.
See this for more details.
Do you use https links instead of ssh links? Because the https link is limited by the size of the upload of HttpServer (such as Apache, Ngnix), there is no such restriction when using ssh.
Use the following method to switch to the ssh link.
If you determine the remote repository name, proceed directly to step 4. Now, you can do the push operation happily.
If you get error 413, then the issue doesn't lie with git but with your web server. It's your web server that is blocking big upload files.
Solution for nginx
Just load your
nginx.conf
and addclient_max_body_size 50m;
( changing the value to your needs ) in the http block.Reload nginx to accept the new config by executing
sudo service nginx reload
and try again to push your commit over http.Solution for Apache
In your
httpd.conf
addLimitRequestBody 52428800
( changing the value to your needs ) inside a<Directory />
block. Doing this you can limit the request of the whole server filesystem, just a single Virtual Host or a directory.I hope this helps.
I got this problem when I try to clone a git repo in Linux machine.
the following URL is working for me in windows
whereas the following URL works in Linux machine and it has https in URL
https clone of gists fails (ssh works, see below):
This works:
git clone git@gist.github.com:123456.git
command to change the remote url ( from https -> git@... ) is something like this
origin here is the name of my remote ( do git remote and what comes out is your origin ).