Created
July 27, 2026 14:27
-
-
Save meangrape/da921ed60a553a5c9e22ae1d4852b752 to your computer and use it in GitHub Desktop.
List git branches in reverse chronological order
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
| # List local branches by date | |
| function gbL() { | |
| git for-each-ref --sort=-committerdate refs/heads/ \ | |
| --format='%(refname:short)|%(committerdate:relative)|%(subject)' \ | |
| | gawk -F '|' '{ printf "%-30s | %-20s | %s\n", $1, $2, $3 }' | head -10 | |
| } | |
| # List remote branches by date | |
| function gbLr() { | |
| git for-each-ref --sort=-committerdate refs/remotes/origin \ | |
| --format='%(refname:short)|%(committerdate:relative)|%(subject)' \ | |
| | gawk -F '|' '{ printf "%-30s | %-20s | %s\n", $1, $2, $3 }' | head -10 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment