Skip to content

Instantly share code, notes, and snippets.

@taywils
Created October 1, 2018 20:23
Show Gist options
  • Save taywils/51ec7327b7c629b4dd855b2c88e45f52 to your computer and use it in GitHub Desktop.
Save taywils/51ec7327b7c629b4dd855b2c88e45f52 to your computer and use it in GitHub Desktop.
Git projects
if echo $PWD | grep -e "./projects"; then
allArgs="$*"
basedir=$PWD
for curdir in */; do
cd $curdir
if test -d ./.git
then
echo "\n\n${curdir}\n\n"
git ${allArgs}
fi
cd $basedir
done
else
echo 'This script must be ran from within your ~/projects directory'
echo 'Change directories until you get there and run it again'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment