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

后端 未结 5 1925
太阳男子
太阳男子 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 00:51

    You could use turn off the delta attribute to disable delta compression for just the blobs of those pathnames:

    In foo/.git/info/attributes (or foo.git/info/attributes if it is a bare repository) (see the delta entry in gitattributes and see gitignore for the pattern syntax):

    /large_file_dir/* -delta
    *.psd -delta
    /data/*.iso -delta
    /some/big/file -delta
    another/file/that/is/large -delta
    

    This will not affect clones of the repository. To affect other repositories (i.e. clones), put the attributes in a .gitattributes file instead of (or in addition to) the info/attributes file.

提交回复
热议问题