The remote end hung up unexpectedly while git cloning

后端 未结 30 3019
旧时难觅i
旧时难觅i 2020-11-22 09:02

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

What could be the issue here?

30条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 09:25

    Based on this answer, I tried following (with https url):

    1. initial cloning of repo:

    git clone --depth 25 url-here

    1. fetch commits with increasing twice per try depth:

    git fetch --depth 50

    git fetch --depth 100

    git fetch --depth 200

    ...and so on

    1. eventually (when I think enough is fetched) I run git fetch --unshallow - and it's done.

    The process obviously takes much more time, but in my case setting http.postBuffer and core.compression didn't help.

    UPD: I found out that fetching via ssh works for any repo size (discovered accidentally), done with git clone , given you have created ssh keys. Once repo is fetched, I change remote address using git remote set-url

提交回复
热议问题