The remote end hung up unexpectedly while git clon

2019-01-01 03:07发布

My git client repeatedly fails with the following error after trying to clone the repository for some time.

What could be the issue here?

Note: I have registered my SSH key with the GIT hosting provider

Receiving objects:  13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly

标签: git
27条回答
公子世无双
2楼-- · 2019-01-01 03:21

I had a similar problem, but with a bamboo job. Bamboo was failing doing a local clone (local but over an SSH proxy) of a cached repository, I deleted the cache and after that it worked, but any time it tries to clone from the local cache there is a failure. Seems like a problem with bamboo's version of the SSH proxy not git per se.

查看更多
初与友歌
3楼-- · 2019-01-01 03:22

This is due the internet connectivity issue, i faced the same issue. I did a shallow copy of code using

git clone --depth 1 //FORKLOCATION

Later unshallowed the clone using

git fetch --unshallow
查看更多
余欢
4楼-- · 2019-01-01 03:22

I was doing git push from my OS X El Capitan Mac. I was getting same error, I tried everything to fix, what I found on google/stackoverflow. As far as version is concerned I am using fairly latest version of github which is 2.7.4. I have create a project in my local system, and I wanted this to be public in my github account. Project size was not around 8MB. I noticed that when I was pushing some files of size around 1.5MB, it was pushing properly, but with large size failed for me, with same error,

Only option I had was to push changes in chunk of MB. Now I have pushed all changes. This is workaround for me until I get fix for this solution.

So you can also try pushing change in multiple commit. Or if you have multiple folder you can push changes by each folder (if folder size is not big).

Hope this will help you to continuous working on project.

查看更多
呛了眼睛熬了心
5楼-- · 2019-01-01 03:23

Obs.: Changing http.postBuffer might also require to set up the Nginx configuration file for gitlab to accept larger body sizes for the client, by tuning the value of client_max_body_size.

However, there is a workaround if you have access to the Gitlab machine or to a machine in its network, and that is by making use of git bundle.

  1. go to your git repository on the source machine
  2. run git bundle create my-repo.bundle --all
  3. transfer (eg., with rsync) the my-repo.bundle file to the destination machine
  4. on the destination machine, run git clone my-repo.bundle
  5. git remote set-url origin "path/to/your/repo.git"
  6. git push

All the best!

查看更多
与风俱净
6楼-- · 2019-01-01 03:24

Same error with Bitbucket. Fixed by

git config --global http.postBuffer 524288000
git config --global http.maxRequestBuffer 100M
git config --global core.compression 0
查看更多
浅入江南
7楼-- · 2019-01-01 03:24

Well, I wanted to push a 219 MB solution, but I had no luck with

git config --global http.postBuffer 524288000

And what's the point of having a 525 MB post buffer anyway? it's silly. So I looked at the git error below:

Total 993 (delta 230), reused 0 (delta 0)
POST git-receive-pack (5173245 bytes)
error: fatal: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054

So git want's to post 5 MB, then I made the post buffer 6 MB, and it works

git config --global http.postBuffer 6291456
查看更多
登录 后发表回答