Skip to content

Instantly share code, notes, and snippets.



Last active Apr 20, 2016
What would you like to do?
Git: recent checked out branches
# Outputs in the format (most recent at the bottom)
# (2016-04-15T16:08:25) branch1 -> branch2
# (2016-04-15T16:08:25) branch2 -> branch1
# (2016-04-15T16:08:25) branch2 -> branch3
git reflog --pretty="%aI %gs" | grep 'checkout: moving from' | sort | awk '{ printf "(%.19s) %-30.30s -> %s\n", $1, $5, $7}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.