Skip to content

Instantly share code, notes, and snippets.

@mfcovington
Created January 12, 2016 01:37
Show Gist options
  • Save mfcovington/da5d38903ebb98cdd274 to your computer and use it in GitHub Desktop.
Save mfcovington/da5d38903ebb98cdd274 to your computer and use it in GitHub Desktop.
Find git repositories that need to be pushed to GitHub
REPOS_DIR=~/git.repos
for DIR in find $REPOS_DIR/* -maxdepth 0 -type d; do
cd $DIR
NEEDS_PUSH=`git rev-list develop...origin/develop --count`
if [ "$NEEDS_PUSH" -gt 0 ]; then
echo $DIR >> ~/repos-that-need-pushed
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment