今天在電腦上git clone 遠端倉庫,出現如下錯誤:
git clone https://github.com/altercation/solarized
Cloning into 'solarized'...
remote: Enumerating objects: 2190, done.
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
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
google後,發現原因是遠端倉庫過大,而網絡連接配接有抖動,導緻連接配接斷開的機率增大
解決方法如下:
git clone http://github.com/large-repository --depth 1
cd large-repository
git fetch --unshallow
先做一層淺拷貝,再做深拷貝,即可解決。
source: StackOverflow