In the past, one had to invoke git gc
from time to time. I've read now, that latest Git versions should perform the cleanup automatically. Is this correct?
To an extent...
From the documentation at http://www.kernel.org/pub/software/scm/git/docs/git-gc.html
Pertaining to git gc --auto....
With this option, git gc checks whether any housekeeping is required; if not, it exits without performing any work. Some git commands run git gc --auto after performing operations that could create many loose objects.
So it depends on the commands you are running.
You can setup a cron
task as explained here: http://minhajuddin.com/2011/12/09/gc-your-git-repositories-automatically-with-a-cron-task
As the git help gc
says: users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.
Some git commands may automatically run git gc
. If you know what you’re doing and all you want is to disable this behavior permanently without further considerations, just do:
git config --global gc.auto 0
Also, you can configure prune behaviour:
git config gc.pruneexpire "30 days"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With