repo = git.Repo("...") // Directory that already has a cloned repository
repo.heads
[
The repository has a whole bunch of remote branches but I only see the local one. Any way of getting a list of all remote branches?
I have same issue
You can access remote refs via repo.remotes.origin.refs. You will find more code in context by search for refs in the tutorial.
data = Git().execute('git ls-remote -h git_url')
branches = [ x.split('/')[-1] for x in data.split('\n') ]
GitPython 3.1.2 and this still doesn't work.
Most helpful comment
You can access remote refs via
repo.remotes.origin.refs. You will find more code in context by search forrefsin the tutorial.