Created
August 24, 2016 14:31
-
-
Save michiel/22a37bbeb6de0a9a1f782be22bd04580 to your computer and use it in GitHub Desktop.
Clean out a directory of git repositories
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
#!/bin/bash | |
for d in `find . -maxdepth 1 -type d` | |
do | |
pushd . > /dev/null | |
cd "$d" | |
echo "Trying $d" | |
if [ -d .git ] | |
then | |
git clean -fdx . | |
else | |
echo "Not a git repo - $d" | |
fi | |
popd > /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment