參考鏈接
問題描述:
-
無論是git clone還是pull,均失敗,git clone大致是如下錯誤提示
remote: Counting objects: 5148, done.
remote: Compressing objects: 100% (16/16), 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
分析和解決:
-
因為Git限制了推送數據的大小導致的錯誤。
解決:
-
方法1:重新設置全局的通信緩存大小,增加git緩沖區大小
git config --global http.postBuffer 524288000 git config --list
-
方法2:淺層克隆,深度設置為1
git clone http://github.com/target.git --depth 1 # target.git 為目標地址 cd target #先進入庫路徑下 git fetch --unshallow # 獲取完整庫
-
注:
- 如果用方法1設置后還不行,試試方法2,差不多就沒問題了