1. 程式人生 > >git_clone資源獲取失敗解決

git_clone資源獲取失敗解決

con failed with depth ogl all compress conf fig

github上克隆一個倉庫到本地,一直失敗。還以為是git安裝問題,卸載重裝無效;又換了個大容量的磁盤目錄位置;最後ECS系統也重裝還是無效。。

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

然後google了下(為什麽我不一開始就搜索。。。想當然瞎折騰)

原因是要克隆的倉庫太大,文件多,導致git clone失敗。

解決:

  • 方法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

git_clone資源獲取失敗解決