Skip to content

Instantly share code, notes, and snippets.

@aidin36
Created August 30, 2018 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aidin36/43e22ea12650c9c7125959c4e2399ce8 to your computer and use it in GitHub Desktop.
Save aidin36/43e22ea12650c9c7125959c4e2399ce8 to your computer and use it in GitHub Desktop.
A script to garbage collect all git directories inside the corrent directory. i.e. clean up your workspace.
#!/bin/zsh
set -e
CURRENT_PATH=`pwd`
for p in `find . -name .git -print`; do cd $(dirname $p);git gc;cd $CURRENT_PATH; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment