Search code examples
multithreadinggitmemorygit-gc

Number of threads for git gc depending on repo size


Can I use single-threaded compression in Git for large repositories and usual parallelized one for small ones? Like "pack.threads=1" if don't easily fit in momory and "pack.threads=4" otherwise.

As I heart somewhere, multithreaded "git gc" requires a lot memory and thrashes (or just fails) longer that singlethreaded.

I want it to work fast for small repos and don't fail on big repos.


Solution

  • You can configure pack.threads per repository, but I doubt that there is a setting to do this automatically depending on the size of the repository.