Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get remote branches for git URL without local git

Tags:

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!

like image 229
orshachar Avatar asked Feb 06 '26 01:02

orshachar


1 Answers

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.

like image 180
VonC Avatar answered Feb 08 '26 15:02

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!