ftcxza
Last Updated: February 25, 2016
·
376
· webdevwilson
520a0b621575028b78321af64d34108e

Automatically keep your git repos tidy

git

'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
}
Say Thanks
Respond