To list the branches, you can currently use:
from git import Repo r = Repo(your_repo_path) repo_heads = r.heads
r.heads returns git.util.IterableList (inherits after list ) of git.Head objects, so you can:
repo_heads_names = [h.name for h in repo_heads]
And for verification, for example. master :
repo_heads['master'].checkout() # you can get elements of IterableList through it_list['branch_name'] # or it_list.branch_name
The module mentioned in the question is GitPython , which is moved from gitorious to Github .
pkowalczyk
source share