Git pull 失败并出现错误的包头错误

标签 git

git pull 失败并出现以下错误

remote: Counting objects: 146, done.
remote: fatal: unable to create thread: Resource temporarily unavailable
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header

任何想法如何成功 pull ?

最佳答案

remote 开头的行是在远程系统上运行的git 的输出。错误:

fatal: unable to create thread: Resource temporarily unavailable

...强烈建议您已经用完服务器上的内存,如果您有以下任一情况,则可能会发生这种情况:

  1. 包含大量大文件的存储库,这可能导致重新打包占用大量内存。
  2. 有限的虚拟内存 - 一般情况下,或由于 ulimit 设置而仅针对该帐户

一个建议here是通过登录远程系统(作为 git 运行的用户)并执行以下操作来限制打包可能占用的内存量:

git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1" 

关于Git pull 失败并出现错误的包头错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7362709/

相关文章:

git - 如何显示已上演的更改?

git - 如何仅在 pull 请求时在 Jenkins 中运行阶段?

git - 强制 'git merge' 将所有差异声明为 merge 冲突

Git Rebase 期间的 Git Commit - 到底发生了什么?

linux - Linux 上的 git,正确的路径,错误的版本号

git - 试图用 git for windows 理解 wincred - 困惑

git - 如何使用SRC_URI获取浅拷贝?

git - 下面两种说法明显矛盾

git - 将代码推送到多个源

git - Unity 团队中的 .gitignore 相当于什么?