deb-python-pygit2/docs/recipes/git-branch.rst
2013-07-05 20:14:33 -04:00

993 B

git-branch

Listing branches

List all branches

$> git branch
>>> regex = re.compile('^refs/heads/')
>>> branches = filter(lambda r: regex.match(r), repo.listall_references())

Note that the next release will probably allow repo.listall_branches().

References