Skip to content

Instantly share code, notes, and snippets.

@larsklevan
Created August 25, 2009 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save larsklevan/174756 to your computer and use it in GitHub Desktop.
Save larsklevan/174756 to your computer and use it in GitHub Desktop.
#!/bin/bash
for i in `git branch | cut -c '3-'`; do echo `git log --pretty="format:%ct %cd" -1 $i | xargs printf "%50s"` $i; done | sort -n | cut -d\ -f2-
# alias version
# alias branches="for i in \`git branch | cut -c '3-'\`; do echo \`git log --pretty='format:%ct %cd' -1 \$i | xargs printf '%50s'\` \$i; done | sort -n | cut -d\ -f2-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment