如何在垃圾收集时禁用 git 增量压缩

How to disable to git delta compression when garbage collecting

我正在尝试在存储库上运行 git gc 但它失败了,因为它在增量压缩阶段内存不足。我认为这是因为某些物体太大了。有没有办法避免这个内存问题(或禁用压缩)?

您可以测试“Stopping a git gc --aggressive, is that a bad thing?

的设置
git config pack.threads 1
git config pack.deltaCacheSize 1
git config core.packedGitWindowSize 16m
git config core.packedGitLimit 128m
git config pack.windowMemory 512m

其次是:

git gc --aggressive

同时检查,如果您有 Git2.0+(因此 [=31= 的 git 不可用,限于 1.9.5),my answer:

git gc --aggressive --depth=x

(尝试与默认值 250 不同的值)

2017 年 5 月更新:Git2.13.x/2.14(2017 年第 3 季度)将显着增加 core.packedGitLimit(高达 32 GiB!)。
参见“fatal: early EOF fatal: index-pack failed”。