Skip to content

Instantly share code, notes, and snippets.

@tommoor
Created January 16, 2013 12:56
Show Gist options
  • Save tommoor/4546953 to your computer and use it in GitHub Desktop.
Save tommoor/4546953 to your computer and use it in GitHub Desktop.
List git branches in reverse order of activity. An easy way to find and delete unused / old branches
for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment