I really like how the Github /branches page lists the branches and a column that indicates the number of commits ahead or behind master for a branch.
Is there a way to see this information in the console/cli?
Edit: This solution shows how to get the commits ahead/behind for a single branch. But how could I do that for all local branches?
git for-each-ref refs/heads/ --format='%(refname:short)' |
while read branch; do
echo -n "$branch: "
git rev-list --left-right --count master..$branch
done
Docs: