< BACK

Git tips and tricks

List branches ahead or behind remote

git branch -v | grep -E 'ahead|behind' | sed -r 's/[ *]\s(\S*).*(\[(ahead|behind).+?\]).*/\1 \2/g'

See reference.