Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all the active branches in Git remote

Tags:

git

git-branch

I am looking for a way to list all the active branches that are available on remote git repository. I tried:

git branch -r 

But this listed the already deleted branches as well. I do not want the list to display deleted branches.

like image 910
moz8 Avatar asked Apr 16 '15 11:04

moz8


1 Answers

You can try (using git ls-remote):

git ls-remote --heads origin

That would list the branches directly from the remote repo. No fetch necessary.

like image 61
VonC Avatar answered Sep 18 '22 14:09

VonC