Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show information about only the current branch

Tags:

git

git branch -v shows a very nice list of all branches with their refs and last commit title. I would like to include that information (i.e. branch name, ref and commit title) in the log output from a script, but I only want it for the currently active branch.

Is there a way to get git to show me just the current branch?

like image 540
John F. Miller Avatar asked Feb 03 '26 02:02

John F. Miller


1 Answers

Something like this should work

git branch --list -v `git rev-parse --abbrev-ref HEAD`
like image 151
Phil Avatar answered Feb 05 '26 19:02

Phil