Last active
January 13, 2016 18:16
-
-
Save jjthrash/fe49da9c1f7972bfe567 to your computer and use it in GitHub Desktop.
Put this in your path as `git-recent-branch` and you can do `git recent-branch` and `git recent-branch -r`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
branches=`git branch $* | perl -pe 's/^..(.*?)( ->.*)?$/\1/'` | |
for k in $branches; 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