Last active
April 20, 2016 13:30
-
-
Save samiraguiar/69b09416913a7eed5f6b78cc7c0b951b to your computer and use it in GitHub Desktop.
Git: recent checked out branches
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 | |
# 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