Created
October 28, 2010 19:57
-
-
Save nfarring/652206 to your computer and use it in GitHub Desktop.
Iterates through all of the git repos in the current directory and performs some git operation. The default is 'git status'.
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
#!/usr/bin/env bash | |
GITCMD=status | |
if [[ -n $1 ]]; then | |
GITCMD=$1 | |
fi | |
echo | |
for dir in `ls`; do | |
(if [[ -d "$dir" && -d "$dir/.git" ]]; then | |
cd $dir | |
echo $dir | |
git "$GITCMD" | |
cd .. | |
echo | |
fi) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment