Skip to content

Instantly share code, notes, and snippets.

@zjhiphop
Forked from garryyao/git-bundle
Last active December 25, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zjhiphop/6989981 to your computer and use it in GitHub Desktop.
Save zjhiphop/6989981 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Issue arbitary git command for each of the sub modules.
# E.g. git-bundle checkout feature/docs
# Check out the feature/docs branch for each of the sub module.
function print_header
{
printf '%.0s-' {1..30} && echo
echo $1
printf '%.0s-' {1..30} && echo
}
# Blobing pattern for directories, replace with whatever u like.
PATTERN="**/troopjs-*"
# Pass all params to git command.
COMMAND=$@
for i in $PATTERN
do
print_header $i && cd $PWD/$i && git $COMMAND && printf '\n\n\n'
done
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment