Is there a way to limit the amount of memory that “git gc” uses?

后端 未结 5 1923
太阳男子
太阳男子 2020-11-29 00:12

I\'m hosting a git repo on a shared host. My repo necessarily has a couple of very large files in it, and every time I try to run \"git gc\" on the repo now, my process get

5条回答
  •  粉色の甜心
    2020-11-29 01:01

    Yes, have a look at the help page for git config and look at the pack.* options, specifically pack.depth, pack.window, pack.windowMemory and pack.deltaCacheSize.

    It's not a totally exact size as git needs to map each object into memory so one very large object can cause a lot of memory usage regardless of the window and delta cache settings.

    You may have better luck packing locally and transfering pack files to the remote side "manually", adding a .keep files so that the remote git doesn't ever try to completely repack everything.

提交回复
热议问题