Skip to content

Instantly share code, notes, and snippets.

@agoddard
Created December 3, 2014 05:10
Show Gist options
  • Save agoddard/cdb95b903a3a91c721c8 to your computer and use it in GitHub Desktop.
Save agoddard/cdb95b903a3a91c721c8 to your computer and use it in GitHub Desktop.
poor mans git checker
#!/bin/sh
for i in $(ls -d */); do
cd ${i%%/};
if [ -d .git ]; then
modified=`git status --porcelain | grep M`
untracked=`git status --porcelain | grep "?"`
unpushed=`git status | grep ahead`
if ! [ -z "$modified" ]; then
echo "${i%%/} contains uncommitted changes"
fi
if ! [ -z "$untracked" ]; then
echo "${i%%/} contains untracked files"
fi
if ! [ -z "$unpushed" ]; then
echo "${i%%/} has not been pushed"
fi
fi
cd ../
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment