Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DmitriyZaitsev/f9fe017c11a708311c73f23dcf92ee3e to your computer and use it in GitHub Desktop.
Save DmitriyZaitsev/f9fe017c11a708311c73f23dcf92ee3e to your computer and use it in GitHub Desktop.
Easily track which branches need updating (http://stackoverflow.com/a/866353/965226)
git for-each-ref 'refs/heads/*' | \
while read rev type ref; do
branch=$(expr "$ref" : 'refs/heads/\(.*\)' )
revs=$(git rev-list $rev..master)
if [ -n "$revs" ]; then
echo $branch needs update
git diff --summary --shortstat -M -C -C $rev master
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment