Github Push Error: RPC failed; result=22, HTTP code = 413

I figured it out!!! Of course I would right after I hit post!

I had the repo set to use the HTTPS url, I changed it to the SSH address, and everything resumed working flawlessly.


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 add client_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 add LimitRequestBody 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 had the same problem but I was using a reverse proxy.

So I had to set

client_max_body_size 50m; 

inside both configure files :

  • on the gitlab nginx web server (as said inside the previous answers)
  • but also on the nginx reverse proxy hosted on the dedicated server.

command to change the remote url ( from https -> git@... ) is something like this

git remote set-url origin [email protected]:GitUserName/GitRepoName.git

origin here is the name of my remote ( do git remote and what comes out is your origin ).