最近一直沒解決 git clone
時出現中斷的問題
Cloning into '/Users/Sirormy/sdk/clang/fastcomp/src'...
remote: Counting objects: 1225089, done.
remote: Compressing objects: 100% (22/
remote: Compressing objects: 100% (22/
re) RPC failed; result=18, HTTP code = 20050 MiB | 1.08 MiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed clone', 'https://github.com/kripken/em...', '/Users/Sirormy/sdk/clang/fastcomp/src'] failed with error code 128!
Installation failed!
基本可靠的回答都看了一遍, 基本上是以下幾種:
有人說這樣
git config --global core.compression -1
或修改 ~/.gitconfig
autocrlf = input
excludesfile = /Users/Sirormy/.gitignore_global
packedGitLimit = 5120m
packedGitWindowSize = 5120m
compression = 1
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[commit]
template = /Users/Sirormy/.stCommitMsg
[pack]
deltaCacheSize = 5120m
packSizeLimit = 5210m
windowMemory = 5210m
[http]
postBuffer = 1048576000
還有 Stackoverflow 得票最高的, 這樣
First, turn off compression:
git config --global core.compression 0
Next, let's do a partial clone to truncate the amount of info coming down:
git clone --depth 1 <repo_URI>
When that works, go into the new directory and retrieve the rest of the clone:
git fetch --unshallow
or, alternately,
git fetch --depth=2147483647
Now, do a regular pull:
git pull --all
測試中型專案使用這幾種方法能夠解決, 但超大項目比如我clone emscripten的時候就會有問題, 大約50M左右的時候就會報上述錯誤.
git 重裝過依然沒有解決, 排除了git軟體本身的問題, 目前版本是
git version 2.3.2 (Apple Git-55)
由於某些場景是程式碼中自動拉取的 git 資源, 所以手動下載不能解決所有問題
所以我該怎麼辦? 如果你有解決方法, 請測試一下然後告訴我
git clone https://github.com/kripken/emscripten.git
專案有些大, 但是如果下載超過59M還沒有錯誤的話, 那就是答案了.
謝謝~
執行
git repack -a -f -d --window=250 --depth=250
即可。如果還是報錯則請執行:
也可以更換為 SSH 位址:
git clone git@github.com:kripken/emscripten.git
Debug 文件:https://coding.net/help/faq/g...