Created
April 19, 2019 13:17
-
-
Save brimston3/cadc234ffb630c44bd565c41280d14d2 to your computer and use it in GitHub Desktop.
gc repack prune all visible git working repositories
This file contains hidden or 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
#!/bin/zsh | |
# Can't figure out how this works or why you might want to do this? Don't do it. | |
# Don't. Do. It. | |
pushd | |
locate -b '\.git' | while read -t 1 repo | |
do | |
cd "$(dirname "$repo")" | |
git gc | |
git repack -Ad | |
git prune | |
done | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment