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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With