git_clone資源獲取失敗解決


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM