Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chronological list of branches?

Tags:

git

Is there a way to have the list of your (local) branches ordered by the date of the last commit on it (along with the id of the commit, maybe)? When you have tons of branches, like me, it could be sometime useful just to have a look at your most recent work just looking at the list of branches (without inspecting the logs).

like image 572
Claudio Avatar asked Apr 17 '12 08:04

Claudio


People also ask

How can I get a list of git branches ordered by most recent commit?

Use git branch --sort=-committerdate to display a list of all local branches and sort them based on the date of their last commit. Use arrow keys to navigate, press Q to exit.


1 Answers

You can do it as explained in How can I get a list of git branches, ordered by most recent commit? but an easier way would be to install gitk which does exactly what your are doing. Gitk provides views than can display the all branches or only the branch that you want sorted by some field, like last commit, author, title, etc.

To learn it is really easy. Here is another related question to gitk Guide to understanding gitk?

like image 113
Gil Avatar answered Oct 20 '22 16:10

Gil