Anonymous
Anonymous

Reputation: 9648

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

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.

Upvotes: 15

Views: 5417

Answers (1)

VonC
VonC

Reputation: 1323115

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

Upvotes: 22

Related Questions