Created
June 30, 2015 08:43
-
-
Save viktorklang/2316a5b32e18bd74bc8b to your computer and use it in GitHub Desktop.
shell alias for showing git branches sorted by last activity date
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 gbr='git for-each-ref --sort="-authordate:iso8601" --format=" %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)" refs/heads' |
@gonzaloserrano
Yes, indeed. In this case I opted for brevity :)
The corresponding git alias (in ~/.gitconfig
) would be
[alias]
br = for-each-ref --sort='-authordate:iso8601' --format=' %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)' refs/heads
By the way:
alias g=git
;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git has a built-in alias support so you don't need to use your shell's one (http://githowto.com/aliases) but then you need to write something like
git br
or whatever you like.