【Git】 Clone failed 克隆失敗的解決方法

CSDN博客

使用 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

參考

  1. 使用Git clone代碼失敗的解決方法

  2. git pull失敗 error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errfno 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

參考

  1. stackoverflow: error: RPC failed; curl transfer closed with outstanding read data remaining

  2. 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,成功了。。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容