Skip to content

Instantly share code, notes, and snippets.

@jcordasc
Created May 4, 2010 14:32
Show Gist options
  • Save jcordasc/389478 to your computer and use it in GitHub Desktop.
Save jcordasc/389478 to your computer and use it in GitHub Desktop.
#!/bin/bash
for i in *.git ; do
( cd $i
RES=$(git status | grep -E '^# (Changes|Changed|Untracked)')
STAT=""
grep -e 'Untracked' <<<${RES} >/dev/null 2>&1
if [ $? -eq 0 ] ; then
STAT="[Untracked]"
fi
grep -e 'Changed' <<<${RES} >/dev/null 2>&1
if [ $? -eq 0 ] ; then
STAT="$STAT [Modified]"
fi
grep -e 'Changes' <<<${RES} >/dev/null 2>&1
if [ $? -eq 0 ] ; then
STAT="$STAT [Staged]"
fi
if [ -n "$STAT" ] ; then
echo "$i : $STAT"
fi
)
done
@subelsky
Copy link

this is EXACTLY what I needed, thanks for posting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment