Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display the most recent commit of each branch in git

Tags:

git

Is there a way to display the most recent commits of each branch in git?

I have a codebase in git that I've set down for a while. There are several branches in it for different features. I need to go in and update/troubleshoot some code However I choose to name them too generically and now I can't tell which one I was working on last, or even which one had my feature in it.

Ideally I would like to see the last commit in each branch to get an overview of where I last left things. Is there a command to do this? I just need to see where I was working last. I want to avoid switching to each branch and looking at its log.

like image 534
user151841 Avatar asked Nov 14 '25 10:11

user151841


2 Answers

git branch -v

will display the (short form of) the most recent commit's SHA1 in its second column and the description after that.

like image 180
Fred Foo Avatar answered Nov 17 '25 06:11

Fred Foo


git show <name_of_the_branch>

will display the most recent commit for the branch <name_of_the_branch>

like image 42
ouah Avatar answered Nov 17 '25 05:11

ouah