This script has been moved to github and is now maintained by bill-auger in order to have a proper issue tracker - all further development and communications will take place there. Thank you for your stars and comments here!
https://github.com/bill-auger/git-branch-status/
this script is also now icluded in jwiegley's git-scripts collection but please direct comments, bug reports, and feature requests to the upstream issue tracker
git
branch -v | grep -E 'ahead|behind' | sed -r 's/[ *]\s(\S*).*(\[(ahead|behind).+?\]).*/\1 \2/g'
does nearly the same. Usinggit branch -vv
one could also get the upstream branch name.