Last active
December 16, 2015 06:19
-
-
Save tjmw/5390765 to your computer and use it in GitHub Desktop.
Show (up to a max of) 5 most recently checked out branches in Git
This file contains 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
git reflog \ | |
| awk '{ print $3, $NF }' \ | |
| grep "^checkout:" \ | |
| awk '{ print $2 }' \ | |
| egrep -v '^([0-9a-f]{40}|[0-9a-f]{7}$)' \ | |
| perl -ne 'print unless $a{$_}++' \ | |
| head -5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment