docwhat's avatardocwhat's blog

git gc for a bunch of directories

Every so often, you might want to run git gc to keep your git repositories running fast. Here’s an easy way to do that.

Assuming you have your git repositories in ~/projects:

find ~/projects -name '.git' -type d -print0 | xargs -0 -Iq env GIT_DIR=q git gc

This works for git fsck as well.

Ciao!

Comments

Gravatar for mike
Mike

Nothin’ like that freshly fscked feeling.

Submit a Comment

docwhat

The personal blog of Christian Höltje.
docwhat docwhat contact