向Azure新仓库推送代码时遇git error: pack-objects died of signal 10错误求助
Git推送Azure仓库遇
pack-objects died of signal 10错误的解决方法 错误信息
➜ git:(master): git push newrepo -v Pushing to https://dev.azure.com/blablabla error: pack-objects died of signal 10 error: pack-objects died of signal 10 fatal: the remote end hung up unexpectedly send-pack: unexpected disconnect while reading sideband packet fatal: the remote end hung up unexpectedly error: failed to push some refs to 'https://dev.azure.com/blablabla'
signal 10对应SIGBUS错误,通常和Git打包时内存不足、仓库存在大文件或本地仓库损坏有关,以下是针对性解决步骤:
降低Git打包内存限制:临时或全局调整Git打包的内存参数,避免内存溢出
# 全局设置 git config --global pack.windowMemory "100m" git config --global pack.packSizeLimit "100m" # 或单次推送时临时设置 git push newrepo -v --pack-window-memory=100m --pack-size-limit=100m排查并处理大文件:仓库内过大的文件会导致打包过程内存占用过高
- 查找仓库内的大文件:
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5 | awk '{print$1}')" - 若找到大文件,可使用Git LFS管理(需Azure仓库启用LFS),或彻底移除大文件后重新推送:
git filter-branch --tree-filter 'rm -rf path/to/large/file' HEAD
- 查找仓库内的大文件:
释放本地内存:关闭其他占用大量内存的程序,或临时增加系统交换内存(如macOS、Linux可调整swap分区)
修复本地仓库:若本地仓库存在损坏,先备份文件,重新克隆远端仓库后再提交推送
git clone https://dev.azure.com/blablabla temp-repo # 将本地文件复制到temp-repo,排除.git目录 cp -r ./your-files/* ./temp-repo/ cd temp-repo git add . git commit -m "Initial commit" git push origin master切换推送协议:尝试使用SSH协议替代HTTPS推送,需先在Azure配置SSH公钥
git remote set-url newrepo git@ssh.dev.azure.com:v3/blablabla git push newrepo master -v
内容的提问来源于stack exchange,提问作者doubando
相关产品推荐
相关产品推荐

