-
-
Save dudadornelles/781d9017c3cbc44cb558 to your computer and use it in GitHub Desktop.
gitr - run git on all subdirs that are git repos
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 | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
function git_execute_r { | |
for dir in `ls -l1d */.git`; do | |
pushd `dirname $dir` >/dev/null | |
printf "${GREEN} :: @ `pwd`\n${NC}" | |
git $@ | |
popd >/dev/null | |
done | |
} | |
git_execute_r $@ | |
# e.g: gitr status will show the status of all your subdirs git repos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment