Why does git run auto-packing on every push to our repo?

后端 未结 1 915
别跟我提以往
别跟我提以往 2020-12-16 13:53

The last few days, each and every push to our git repository has caused auto-packing on the server.

The output on the client when this happens:

~pdr         


        
相关标签:
1条回答
  • 2020-12-16 14:22

    Git decides whether to auto gc based on two criteria:

    1. Are there too many packs? (Literally, are there more than 50 files with .idx in .git/objects/pack?)
    2. Are there too many loose objects? (Literally, are there more than 27 files in .git/objects/17?)

    If for some reason Git is not able to merge the pack files or remove the loose objects in that directory, it will think it needs to auto-gc again next time.

    I would check the contents of the two directories cited above to see if the (default) criteria are met and see if the criteria change after the re-packing.

    Some reasons for failure to complete the process might be:

    • some sort of permissions problem
    • unreachable objects that are ignored by Git's garbage collection or not pruned by default due to their youth
    • insufficient disk space to complete the gc (the repack)
    • insufficient memory to complete the gc (the repack)
    • objects too large to fit in a specified pack size (see git config pack.packSizeLimit which defaults to unlimited but may be overridden by the user)

    You should also ensure of course that the gc related tunable parameters haven't been set unreasonably by looking at:

    git config -l | grep gc
    

    For some other details, see the Git SCM book on Git Internals.

    0 讨论(0)
提交回复
热议问题