The automatic GC feature probably is only designed to work when a repo is updated (push or something), it arguably never happened in our repos that were always only checked-out (manually gc'ing all repos on the master has freed around 500GB of disk space...).
Lightweight Checkout might help, but cannot be done for all situations (for exemple when the changelog is required etc) and doesn't solve this issue on the slaves (repos both have to be cleaned on the master and all the slaves).
Right now we've added a manual job containing a shellscript that weeds through all git repos it finds on the master and all slaves - but naturally this isn't a very good solution. It would be great if there was at least an option like "wipe out repository" etc that would say "gc repository on master and slaves" which could at least be added to the jobs. Even better the gitplugin would perform a manual gc from time to time (or every time) automatically since the auto-gc-feature doesn't work for these usecases.
Is this still in review?
We just had a issue where the .git folder had so much leftover in it that it started to give problems in the Jenkins master.
Running
{{git gc --prune=now }}
manually solved it.
An option to have this done by Jenkins would be nice.