Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - View Remote branches by creation date

Tags:

git

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.

like image 485
Tony Scialo Avatar asked Apr 04 '17 18:04

Tony Scialo


People also ask

How do I see remote branches in git?

To view your remote branches, simply pass the -r flag to the git branch command. You can inspect remote branches with the usual git checkout and git log commands.

How do I find out when a github branch was created?

If anyone likes to see when the branch is created via Github UI. Go to Insights Tab.


1 Answers

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 !

like image 107
Sachin Thapa Avatar answered Oct 22 '22 03:10

Sachin Thapa