Reputation: 5957
Is it possible to see the list of remote branches by creation date instead of alphabetical order?
Right now i use
git branch -r
Which outputs the below list of remote branches:
origin/HEAD -> origin/develop
origin/calendar-view-impl
origin/containers-redesign
origin/develop
origin/dialogs-view-impl
origin/dropdowns-redesign
It would be nice if this could be ordered by CREATION date of the branch.
Upvotes: 23
Views: 13390
Reputation: 702
Building upon the answer given by @sachin-thapa, I have come to the following answer:
git for-each-ref --sort=-authordate | grep 'refs/remotes/origin/' -m 10
This will:
Now, going the extra mile, you can make an alias for this like below, to make it possible to retrieve this list by just typing git recent
.
git config --global alias.recent '!git for-each-ref --sort=-authordate | grep "refs/remotes/origin/" -m 10'
Upvotes: 2
Reputation: 3719
There is a field in git called authordate which can help to achieve similar result, please try following:
git for-each-ref --sort='-authordate'
Hoping this helps.
Cheers !
Upvotes: 29