Skip to main content
All CollectionsUsing GitGit Troubleshooting
Git Push Rejected: Error: Failed to Push Some Refs
Git Push Rejected: Error: Failed to Push Some Refs
Toshi Dávila avatar
Written by Toshi Dávila
Updated over 5 years ago

Possible Reasons

The “Smart HTTP” protocol in Git uses “Transfer-Encoding: chunked” in POST requests when it contains packed objects greater than 1 MB in size.

Some proxy servers do not support this transfer encoding by default, and the requests will be rejected before they can be transferred. Due to this, no extra information will get through.

It is also possible that you are using an outbound proxy, which is causing the issue.

How do I get around this?

Pushing large amounts of data may require a higher http.postBuffer setting on your Git client, which is different from the server.

Check the configuration on your reverse proxy. The reverse proxy might have a connection timeout that is closing the connection.

How to resolve:  Try bypassing the proxy by pushing directly. If this works, it is highly likely that the proxy server is causing the early disconnect and needs to be tuned.

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

  2. Bypass the outbound proxy

  3. Fix your proxy if you need it to get to Stash or;

  4. Bypass your proxy and connect to Stash directly. Check your Git outbound proxy configuration and unset it:

  5. Setting client_max_body_size 0 allows users to push repositories of any size.

Have questions? Email us support@assembla.com

Did this answer your question?