Skip to content

Instantly share code, notes, and snippets.

@glyphobet
Last active December 21, 2015 19:20
Show Gist options
  • Save glyphobet/6353960 to your computer and use it in GitHub Desktop.
Save glyphobet/6353960 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Recommended sort: -k2,2 -k1,1
REMOTE='origin'
BRANCHES=$(git branch -r | grep $REMOTE | grep -v 'HEAD -> ')
for BRANCH in $BRANCHES ; do
git log -n 1 --pretty="%C(yellow)%ci%Creset %x00 %C(cyan)%an%Creset %x00 %C(blue)<%ae>%Creset %x00 %Cred${BRANCH:7}%Creset" $BRANCH
done | sort -t '\0' $@
echo `echo $BRANCHES | wc -w` "remote ($REMOTE) branches found."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment