Git gc uses a lot of memory, even I limited it

I have some big repository which I have to compress and I did not notice any memrory related options help. If git-pack-objects has to repack some objects, it will have to map roughly same big memory. The only way to manage it is to limit number of objects it has to repack.

In your case object already come compressed in small pack files (one for each push). So the git gc has to repack those small pack files into big ones. You could try to create empty pack-<HASH>.keep files next to the big pack files which were creates by last succesful repack. Then maybe next git gc will not try to deltify those objects again.

Tags:

Git

Memory