Broken pipe when pushing to git repository

 ̄綄美尐妖づ 提交于 2019-11-29 23:54:58

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.

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.

I had the same problem, and this worked for me:

git gc --aggressive --prune

It took a while, but after it was done all git operations started working faster.
The push operation that previously failed then succeeded, probably because it became fast enough to avoid some timeout related issue.

Note that a push can still freeze (even with postBuffer increased) when its pack files are corrupted (ie pack-objects fails)

That will be fixed in git 2.9 (June 2016)

See commit c4b2751, commit df85757, commit 3e8b06d, commit c792d7b, commit 739cf49 (19 Apr 2016) by Jeff King (peff).
(Merged by Junio C Hamano -- gitster -- in commit d689301, 29 Apr 2016)

"git push" from a corrupt repository that attempts to push a large number of refs deadlocked; the thread to relay rejection notices for these ref updates blocked on writing them to the main thread, after the main thread at the receiving end notices that the push failed and decides not to read these notices and return a failure.

Commit 739cf49 has all the details.

send-pack: close demux pipe before finishing async process

This fixes a deadlock on the client side when pushing a large number of refs from a corrupted repo.

I met the same problem when uploading my gigabytes of data to github repository. Increasing the HTTP buffer size did not work for this size of data. I am not sure if it is a problem of git itself or github server. Anyway I made a shell script to handle this problem, which uploades files in the current directory step by step, in each step less than 100 MB of data. It is working fine for me. It takes time but I can just detach screen and wait overnight.

Here is the shell script: https://gist.github.com/sekika/570495bd0627acff6c836de18e78f6fd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!