Created
January 7, 2013 22:10
-
-
Save IQAndreas/4478999 to your computer and use it in GitHub Desktop.
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/bash | |
if [ $# -lt 1 ]; then | |
echo "[clear-git-directory.sh] Please specify the GIT repository to clear." | |
exit 1; | |
elif [ ! -d "$1/.git" ]; then | |
echo "[clear-git-directory.sh] Cannot find a GIT repository in '$1'." | |
exit 1; | |
else | |
cd "$1"; | |
shopt -s extglob dotglob; | |
rm -rf !(.git); | |
fi | |
# --- OUTPUT --- | |
$ utils/clear-git-directory.sh bin | |
utils/clear-git-directory.sh: line 12: syntax error near unexpected token `(' | |
utils/clear-git-directory.sh: line 12: ` rm -rf !(.git);' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment