git clone下来时下载半天的解决办法

有时候从github下载项目下来,由于项目提交历史过多,从git clone下来时,会因为文件太大出现

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

 

这时候我们通过在clone后面加上参数:--depth 1,设置clone深度为1,来解决这个问题。

如:

$ git clone /github_com/something  --depth 1

 

你可能感兴趣的:(git使用)