Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created March 20, 2014 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusynth/9665929 to your computer and use it in GitHub Desktop.
Save krusynth/9665929 to your computer and use it in GitHub Desktop.
Get most recent commit for every repo the user has access to.
from github import Github
from datetime import datetime
g = Github("user", "pass")
since = datetime(2014, 1, 1)
for org in g.get_user().get_orgs():
print org.name
for repo in org.get_repos():
commit = ''
commits = repo.get_commits(since=since).get_page(0)
if commits:
commit = commits[0].sha
print u'|- {0} ({1})'.format(repo.name, commit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment