Created
July 19, 2011 10:16
-
-
Save nfelger/1091907 to your computer and use it in GitHub Desktop.
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/sh | |
# Take the command to execute from the command line. | |
command=$@ | |
# Default to updating the project if no command given. | |
[ -z "$command" ] && command='git pull --rebase ; git submodule init && git submodule update' | |
# Colors. | |
boldgreen=$(tput bold)$(tput setaf 2) | |
colorreset=$(tput sgr0) | |
for d in `ls` | |
do | |
if [[ -d $d/.git ]] | |
then | |
echo "In project $boldgreen$d$colorreset" | |
pushd $d > /dev/null | |
eval $command | |
popd > /dev/null | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, updating all repos is the default, so, to get all the latest changes into your local repos, simply do:
To get a compact status for all projects, I suggest a shortened format:
Of course any other command will work as well. Eval'ing user input like it's 1958.