I want a list of all my branches from a repository from github. so i can do something like this.
print(branches[1])
and ill get an output of a branch name. I haven't found a straight answer on how to do this.
CodePudding user response:
import subprocess
subprocess.check_output(['git', 'branch']).decode().split('\n')
CodePudding user response:
You can refer the below mentioned answer for a similar type question.
git branch -r