How to use "git log –graph –oneline –all" only on my local branches?

Issue

I would like to see all my local branches, but none of the remote tracking refs like origin/master

This command shows me a nice graph decorated with all my local and remote tracking branches:

git log --oneline --graph --decorate --all

What flag should I add/remove in this command to show only local branches?

Solution

Ain’t sure what you need but how about something like:

git log --graph --oneline --branches --not --remotes=*

Note that it may filter out the whole log (e.g. in the case when you have an up-to-date
branch so there is nothing you have only locally). Please consult git help log for the details.

If you need only the names and the last commit you can simply use:

git branch -v

Probably you can mix these to fit your needs.

But my preferred choice is gitk --all, here’s an example output:

enter image description here

Answered By – rlegendi

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published