Created
November 27, 2017 18:11
-
-
Save alfredormz/69a2f1129caff0eae366f220bc871e62 to your computer and use it in GitHub Desktop.
List git branches, ordered by most recent commit
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
for k in `git branch | sed s/^..//`; do | |
echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k"; | |
done | sort -r |
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
git for-each-ref --sort=-committerdate refs/heads/ |
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
git branch --sort=-committerdate # DESC | |
git branch --sort=committerdate # ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment