How to resolve the error “http.postBuffer” when push to Git repository

When pushing to a remote Git repository, the following error may occur and cause it to fail.

error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; curl 56 LibreSSL SSL_read: Connection reset by peer, errno 54
send-pack: unexpected disconnect while reading sideband packet

In my case, this error occurred when pushing to AWS CodeCommit. There are two ways to fix it.


Method 1: Increase the http.postBuffer

The method 1 is to increase the value of http.postBuffer as it is output to the shell. Do the following

git config --global http.postBuffer 524288000

The value may vary depending on the environment, but for now, specify a large value since a large value should be sufficient.

In some cases, this method seems to fix the problem, but in my case, this method did not fix it.

Method 2: Change the connection protocol.

The error output to the shell indicates that there is a problem with the capacity of the http transfer. Git supports connections via ssh as well as https. To connect with the ssh , do following.

Upload your public key to the server.

You need to register your public key of ssh to connect with ssh protocol.

Change the repository URL.

Change the URL to the ssh connection URL with git remote set-url.

git remote set-url origin ssh://URL_TO_REPOSITORY
Verify the URL.

Verify the URL with git remote -v. Normally, both fetch and push are changed in STEP 2, but sometimes only push remains the same. In this case, change the URL for push as follows.

git remote set-url --push origin ssh://URL_TO_REPOSITORY

In my case, I was able to solve the problem by changing to ssh, Method 2, and was able to push successfully.

Let's share this post !

Author of this article

Akira Hayashiのアバター Akira Hayashi Representative, Software Engineer

I am an application developer loves programming. This blog is a tech blog, its articles are learning notes. In my work, I mainly focus on desktop and mobile application development, but I also write technical books and teach seminars. The websites of my work and books are here -> RK Kaihatsu.