Skip to content

Instantly share code, notes, and snippets.

@cgrinaldi
Last active September 18, 2015 10:08
Show Gist options
  • Save cgrinaldi/abb812f4e23a4ce97a87 to your computer and use it in GitHub Desktop.
Save cgrinaldi/abb812f4e23a4ce97a87 to your computer and use it in GitHub Desktop.
Check the statuses of multiple git repositories within a shared directory structure
#!/bin/bash
localPATH=`pwd` # path of current directory
sep='---------------'
for d in */; do
echo $sep"Checking Status of" $d$sep
d=`echo $d | sed s#/##` # remove trailing forward slash
git -C $localPATH/$d checkout master # checkout master in different directory
git -C $localPATH/$d status # run git status
echo -e '\n'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment