錯誤詳細信息:
Cloning into 'aplanmis-project'...
remote: Enumerating objects: 176887, done.
remote: Counting objects: 100% (176887/176887), done.
remote: Compressing objects: 100% (75181/75181), 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 clone項目到本地。
通過關鍵字搜索找到對應的解決方案如下:
1.緩沖區設置大小
git config --global http.postBuffer 524288000 # 2GB git config --global http.postBuffer 2097152000 # 2GB git config --global http.postBuffer 3194304000 # 3GB
2.網絡原因
git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999
3.少git clone一些
git clone git地址 --depth 1
上面的三個辦法我均嘗試,但仍然沒有解決這個問題。於是我仔細一想,自建的git通過nginx代理,可能與nginx有關,然后我關鍵字搜索nginx大文件下載失敗問題,於是找到了解決方案:
參考了該鏈接,如下:
Nginx反向代理導致大文件下載失敗
該鏈接提供了兩個解決方案,我嘗試了第一個解決方案就解決了該問題。
在nginx代理配置如下(location標簽配置即可):
proxy_redirect default; proxy_buffering off;