錯誤信息一:
Clone failed RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function. The remote end hung up unexpectedly early EOF index-pack failed
解決方法:
打開終端
git config --global http.postBuffer 524288000
--------------------------如果可以正常下載的話,可以不看以下內容--------------------------------
修改配置文件
gedit ~/.bashrc
然后在配置文件的最下面加上這三行
export GIT_TRACE_PACKET=1 export GIT_TRACE=1 export GIT_CURL_VERBOSE=1
然后保存退出后運行:
source ~/.bashrc
使配置文件生效
依舊不行,可嘗試:
需要如下方式命令,只clone深度為一
$ git clone https://github.com/JGPY/large-repository.git --depth 1 $ cd large-repository $ git fetch --unshallow
depth用於指定克隆深度,為1即表示只克隆最近一次commit.(git shallow clone)
git clone 默認會下載項目的完整歷史版本,如果你只關心最新版的代碼,而不關心之前的歷史信息,可以使用 git 的淺復制功能:
$ git clone --depth=1 https://github.com/JGPY/large-repository.git
--depth=1 表示只下載最近一次的版本,使用淺復制可以大大減少下載的數據量,例如, CodeIgniter 項目完整下載有近 100MiB ,而使用淺復制只有 5MiB 多,這樣即使在惡劣的網絡環境下,也可以快速的獲得代碼。如果之后又想獲取完整歷史信息,可以使用下面的命令:
$ git fetch --unshallow
或者,如果你只是想下載最新的代碼看看,你也可以直接從 GitHub 上下載打包好的 ZIP 文件,這比淺復制更快,因為它只包含了最新的代碼文件,而且是經過 ZIP 壓縮的。但是很顯然,淺復制要更靈活一點。
錯誤信息二:
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
這個錯誤是因為項目太久,tag資源文件太大
解決方法一:
網上大部分解決措施:命令終端輸入
git config --global http.postBuffer 524288000
用上面的命令有的人可以解決,我的還不行,需要如下方式命令,只clone深度為1
git clone /github_com/large-repository --depth 1 cd large-repository git fetch --unshallow
中划線處填入你的git倉庫的地址。。。(我用的是http方式,不是ssh)
解決方法二:
一般clone http方式的容易產生此問題,改成SSH的方式也有效,即https://改為git://
相關拓展博客地址:
http://www.jianshu.com/p/0e3421961db4
http://blog.csdn.net/h5q8n2e7/article/details/46919579
原文鏈接:
Clone failed RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
git報錯--RPC failed; curl 18 transfer closed with outstanding read data remaining