在执行 git clone
命令遇到以下错误:
remote: Enumerating objects: 1252, done.
remote: Counting objects: 100% (1252/1252), done.
remote: Compressing objects: 100% (788/788), done.
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
参考:https://stackoverflow.com/questions/66366582/github-unexpected-disconnect-while-reading-sideband-packet
- Windows cmd 执行:
set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1
- Windows powershell 执行:
$env:GIT_TRACE_PACKET=1
$env:GIT_TRACE=1
$env:GIT_CURL_VERBOSE=1
- Linux 执行:
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
执行,其中仓库地址为Http地址:
git config --global core.compression 0
git clone --depth 1 [仓库URI]
cd [项目路径]
git fetch --unshallow
git pull --all