遇到代码仓库比较大,在克隆的时候会报错
remote: Counting objects: 14764, done.
remote: Compressing objects: 100% (8124/8124), done.
fatal: The remote end hung up unexpectedly0 GiB | 12.86 MiB/s
fatal: early EOF
fatal: index-pack failed
原因是要克隆的目标代码库过大;此时的解决办法是:
git clone --depth 1 https://github.com/...
git remote set-branches origin 'remote_branch_name'
git fetch --depth 1 origin remote_branch_name
git checkout remote_branch_name