git clone報錯fatal: the remote end hung up unexpectedly01) faltal:early EOF fatal:index-pack failed

完整報錯

remote: Enumerating objects: 19698, done.
remote: Counting objects: 100% (19698/19698), done.
error: RPC failed; curl 56 OpenSSL SSL_read: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading, errno 0
fatal: the remote end hung up unexpectedly01)
fatal: early EOF
fatal: index-pack failed

同一個git倉庫地址,不同的報錯內容
remote: Enumerating objects: 19936, done.
remote: Counting objects: 100% (19936/19936), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header


初步嘗試解決方案

  • 修改提交緩存大小爲500M,或者更大的數字git config --global http.postBuffer 1048576000
  • 配置git的最低速度和最低速度時間:
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999  

以上解決方案全部無效

想來想去,有一種可能是remote 倉庫太大導致的問題,於是決定只拉取指定分支dev_branch

mkdir Project
cd Project
git init
git remote add origin remote_repo_url
git pull origin dev_branch

成功解決問題


備註

有時候我們嘗試各種百度方案後,會忘記原本的git bash 環境設置
打開 C:\Users\用戶名下面有一個.gitconfig配置文件,裏面存儲着用戶的環境設置。
如果想恢復默認的環境,清空文件內容即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章