That error code is a timeout error on the client. Although I suspect that the server-side is closing as the message suggests. To try and get more information you could try setting the environment variable GIT_CURL_VERBOSE=1
for your push eg:
GIT_CURL_VERBOSE=1 git push origin
This can give you an indication of whether it is the client timing out or the server disconnecting that is the original error. There are a number of things you might do to ensure that you're not always coming across this error.
- Check the timeouts on the server side, if you can control it. They may be too small. This depends on the server implementation.
- Check your repository for large files particularly binary files. These can be handled differently.
- Ensure you aren't setting http.lowSpeedLimit, http.lowSpeedTime inadvertently: they should be off by default (by looking at the code).
Large Repository
For point 2. There are a number of things you can do if you suspect that the pack you are pushing is large objects. This blog post is quite detailed on the subject:
http://blogs.atlassian.com/2014/05/handle-big-repositories-git/
I don't think the http.postBuffer is really a solution here.