Git: How do I list only local branches?

munyengm picture munyengm · Sep 11, 2012 · Viewed 662.9k times · Source

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?

Answer

gertvdijk picture gertvdijk · Sep 11, 2012

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.