Git cloning: remote end hung up unexpectedly, tried changing postBuffer but still failing

前端 未结 2 1144
长情又很酷
长情又很酷 2020-12-30 13:41

I\'m trying to clone a repository. The first time I got to 82%, then it didn\'t budge for half an hour so I cancelled the clone and started over. After that, every time I tr

2条回答
  •  长发绾君心
    2020-12-30 14:09

    One option to reduce the size of the repo by cloning a single branch or my cloning only a certain amount of the past history.

    git clone --depth=20 https://repo.git -b master
    

    will clone only the master branch to a depth of 20 commits. Since this is a much smaller entity it will generally work, and then you can fetch other branches after. Not sure if you can recover the history after but for lots and lots of cases that is unimportant.

提交回复
热议问题