I am looking for a way to list all the active branches that are available on remote git repository. I tried:
git branch -r
But this listed the already deleted branches as well. I do not want the list to display deleted branches.
You can try (using git ls-remote
):
git ls-remote --heads origin
That would list the branches directly from the remote repo. No fetch necessary.
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