Place this at the "root" of your git repos, or even your projects directory.
Like /var/www/git_gc.bash for example, if you save many projects under this dir.
This script will run git reflog expire and git gc with extra options to save
some space when working with heavy & often rebased projects.
Sometimes, it can save up to hundreds of megabytes or even gigabytes of space, depending on the project!
Be careful though, it can lead to huge CPU usage, make sure you run this when you are not working.
Enjoy 😃