Git: How do I list only local branches?

Issue

git branch -a shows both remote and local branches.

git branch -r shows remote branches.

Is there a way to list just the local branches?

Solution

Just git branch without options.

From the manpage:

With no arguments, existing branches are listed and the current branch will be highlighted with an asterisk.

Answered By – gertvdijk

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