Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get branch names without clone or pull from git?

Tags:

git

git-branch

I want to get all branch names of a git repository. Currently, I clone the repository then get them on local machine. This is inefficient because all I need is names and nothing else.

I wonder if it is possible to do that? If so, what command I can use.

like image 781
Anonymous Avatar asked Sep 10 '14 12:09

Anonymous


1 Answers

Locally, without cloning, you can type (using git ls-remote):

git ls-remote /url/of/the/upstream/repo

That will list of the remote HEADS and their associated branches

like image 90
VonC Avatar answered Oct 23 '22 13:10

VonC