Skip to content

Instantly share code, notes, and snippets.

@jayzeng
Created July 9, 2013 19:23
Show Gist options
  • Save jayzeng/5960426 to your computer and use it in GitHub Desktop.
Save jayzeng/5960426 to your computer and use it in GitHub Desktop.
list repo
#!/usr/bin/env python
from github3 import login
def list_branches(token, target_repo):
github_login = login(token=token)
repos = github_login.iter_repos()
for r in repos:
if r.name == target_repo:
for branch in r.iter_branches():
print('%s %s' % (branch.name, branch.commit))
if __name__ == "__main__":
list_branches('', 'app')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment