Skip to content

Instantly share code, notes, and snippets.

@mushinlogit
Last active August 9, 2017 16:02
Show Gist options
  • Save mushinlogit/d3bb4fd7006542a677b101e4e16d73d8 to your computer and use it in GitHub Desktop.
Save mushinlogit/d3bb4fd7006542a677b101e4e16d73d8 to your computer and use it in GitHub Desktop.
gitLatest.sh
#!/bin/bash
# from root directory, traverse child directories and git up, then list their current branch
projs=$(find $PWD -maxdepth 1 -type d)
for proj in $projs
do
cd $proj
git fetch --all -p
git pull
done
echo "Current Branches"
for proj in $projs
do
cd $proj
echo "${proj}"
git branch
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment