Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Broken pipe when pushing to git repository

I'm trying to push for the first time a code to my git repository but i get the following error:

Counting objects: 222026, done.  Compressing objects: 100% (208850/208850), done.  Write failed: Broken pipe222026)  error: pack-objects died of signal 13  fatal: The remote end hung up unexpectedly error: failed to push some refs to 'ssh://[email protected]/<...>' 

I tried to increase the http buffer size (git config http.postBuffer 524288000), I tried to git repack, but it did not work.

I was able to push a very similar size code to another repository (it was not working like this one, but after the git repack it did work). I'm trying to push it to bitbucket.

Any ideas?

like image 905
Deadlock Avatar asked Oct 01 '13 15:10

Deadlock


People also ask

Why git push is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

What is git post buffer?

From the git config man page, http. postBuffer is about: Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally.

What happens if you push without pulling in git?

The forced push will erase all commit history of the remote repository's branch, and replace it to your branch. Check the answers for doing forced pushes in "How do I properly force a Git push?".

What happens if I git push in a branch?

By default, git push only updates the corresponding branch on the remote. So, if you are checked out to the main branch when you execute git push , then only the main branch will be updated. It's always a good idea to use git status to see what branch you are on before pushing to the remote.


2 Answers

Simple solution is to increase the HTTP post buffer size to allow for larger chunks to be pushed up to the remote repo. To do that, simply type:

git config http.postBuffer 52428800 

The number is in bytes, so in this case I have set it to 50MB. The default is 1MB.

like image 52
Milan Saha Avatar answered Oct 13 '22 07:10

Milan Saha


I had that issue when working with an arch distro on VMWare.

Adding

IPQoS=throughput

to my ssh config (~/.ssh/config) did the trick for me.

like image 31
TsTiX Avatar answered Oct 13 '22 07:10

TsTiX