I have a mirror cloned repository on which I wanted to try git gc
.
When I check the disk usage before and after using git gc
, it actually increase the usage.
Will there be any case in which it actually increases the usage?
I have a mirror cloned repository on which I wanted to try git gc
.
When I check the disk usage before and after using git gc
, it actually increase the usage.
Will there be any case in which it actually increases the usage?
Run git count-objects -v
before and after git gc
. Most likely you will observe that there are more loose objects after the gc
than before. The reason is that unreferenced objects are expunged from the object packs and made loose objects. This way, they gain another 2 weeks of lease of life. This is a safety measure in case that there are concurrent operations on the repository elsewhere. If you are certain that there are no other potential users of the objects, you can prune them right away using
git gc --prune=now