Last active
March 19, 2020 17:52
-
-
Save PHLAK/827716 to your computer and use it in GitHub Desktop.
Performs fsck and gc on all Git repositories in a given directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit pipefail | |
WORKSPACE=${HOME}/workspace # Path to your workspace | |
find ${WORKSPACE} -name '.git' -type d | while read LINE; do | |
pushd "${LINE}/../" | |
git fsck && git gc | |
popd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar functionality with recursive directory searching: https://gist.github.com/384252d5140caa96bcea