Last Updated: February 25, 2016
·
491
· webdevwilson

Automatically keep your git repos tidy

'git gc' will keep your git repos running fast. If you'd like to have it run every time you enter a directory with a git repo. Add the following to your .profile file.

https://gist.github.com/webdevwilson/7139158

# overload cd to gc git when entering a directory
cd () {
 builtin cd "$@"
 if [ -d ".git" ]; then
   (git gc --quiet &)
 fi
}