Created
September 24, 2020 15:03
-
-
Save raharper/488c313dfb900056424515b43efe1139 to your computer and use it in GitHub Desktop.
gitconfig aliases for branch management
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
[alias] | |
branchname = !git rev-parse --abbrev-ref HEAD | |
bn = !git branchname | |
branchdate = !git for-each-ref --sort='-authordate' --format='%(refname)@%(authordate)' refs/heads | sed -e 's-refs/heads/--' | column -s @ -t | cat --number | |
bd = !git branchdate | |
bdget = "!sh -c 'git branchdate | tac | tail -n \"$1\" | head -n 1 | awk -F\" \" \"{print \\$2}\"' \"$1\"" | |
cobd = "!git checkout $(git bdget \"$1\") #" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment