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