Skip to content

Instantly share code, notes, and snippets.

@adrianwebb
Created May 17, 2015 18:13
Show Gist options
  • Save adrianwebb/70a798ec8d44edc3fdec to your computer and use it in GitHub Desktop.
Save adrianwebb/70a798ec8d44edc3fdec to your computer and use it in GitHub Desktop.
Check all Git repositories on and under current directory for uncommitted changes.
#!/bin/bash
curr_dir=`pwd`
for dir in $(find $curr_dir -type d)
do
if [ -d "${dir}/.git" ]
then
echo "Checking Git repo: ${dir}"
cd $dir
if [ -z "`git status | grep 'nothing to commit'`" ]
then
echo "`git status`"
fi
fi
done
cd $curr_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment