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
}
Written by Kerry Wilson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#