使用 Android Studio,想 clone 項目,但是進度條下載一段時間后就會報錯失敗。
// 報錯 1
Clone failed
early EOF
The remote end hung up unexpectedly
index-pack failed
RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
參考
分析為 Git 限制了推送數(shù)據(jù)的大小導(dǎo)致的錯誤。
于是,重新設(shè)置全局的通信緩存大小。
// 方法 1
git config --global http.postBuffer 524288000
但是,我用了上述方法后,還是失敗。
這次的報錯為:
// 報錯 2
Clone failed
early EOF
The remote end hung up unexpectedly
index-pack failed
RPC failed; curl 18 transfer closed with outstanding read data remaining
參考
stackoverflow: error: RPC failed; curl transfer closed with outstanding read data remaining
git報錯--RPC failed; curl 18 transfer closed with outstanding read data remaining
// 方法 2
將 clone 地址的 `https://` 改為 `git://`,再嘗試重新 clone 項目。
OK~小型項目 clone 沒有問題了。但是,大型項目還是不行,進度條一直卡在開始的地方。
根據(jù) stackoverflow 的另外一條回答,推斷是項目太大,而網(wǎng)速過慢??梢韵仍O(shè)置深度為 1 進行淺克隆,克隆完成后再進行 update 操作更新項目代碼。
// 方法 3
git clone http://github.com/large-repository --depth 1
cd large-repository
git fetch --unshallow
不過,我使用這個方法還是報錯 curl 18 transfer closed with outstanding read data remaining。
然后我關(guān)了 vpn,再次使用方法 2,成功了。。