Skip to content

Instantly share code, notes, and snippets.

@sebble
Created October 4, 2015 20:49
Show Gist options
  • Save sebble/5aa46834a9293407dfe2 to your computer and use it in GitHub Desktop.
Save sebble/5aa46834a9293407dfe2 to your computer and use it in GitHub Desktop.
Check for changes in all git repos on system
#!/bin/bash
sudo updatedb
for git in `locate -b --regex '^.git$'`; do
cd $git/..;
if git status 2>/dev/null|grep -E '(Untracked|Changes|ahead)'>/dev/null; then
echo Changes in $git;
else
echo None in $git;
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment