Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: How do I list only local branches?

Tags:

git

git-branch

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?

like image 283
munyengm Avatar asked Sep 11 '12 13:09

munyengm


People also ask

How do I fetch all local branches from a remote?

1 Answer. git fetch --all and git pull -all will only track the remote branches and track local branches that track remote branches respectively. Run this command only if there are remote branches on the server which are untracked by your local branches. Thus, you can fetch all git branches.


1 Answers

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.

like image 138
gertvdijk Avatar answered Oct 04 '22 13:10

gertvdijk