orshachar
orshachar

Reputation: 5037

Get remote branches for git URL without local git

Is there a git command that returns a list of remote branches given remote git repository URL?

It doesn't make sense that I need to set up local git repository just for listing all remote branches!

Thanks!

Upvotes: 3

Views: 102

Answers (2)

VonC
VonC

Reputation: 1326782

You can check the output of git ls-remote

 git ls-remote /urL/of/repo

Displays references available in a remote repository along with the associated commit IDs.

Amongst the references listed, you will find refs/heads/xxx, with the names of the branches.

You will find also the tags, and the current HEAD.

You don't need a local repo to execute that command.

Upvotes: 4

René Höhle
René Höhle

Reputation: 27305

You can use git branch for local branches and git branch -r for remote branches. Before you have to fetch the branches with git fetch origin.

With that command you get all new branch informations.

Upvotes: 0

Related Questions