Commit¶
Note
See the official GitHub API v2 documentation for commits.
- class github2.commits.Commit(type)[source]¶
Commit container.
- modified¶
(If present) Datastructure representing what’s been modified since last commit.
- message¶
Commit message.
Author metadata (dict with name/email.)
Date authored.
- committer¶
Comitter metadata (dict with name/email.)
- tree¶
Tree SHA for this commit.
- id¶
Commit ID.
- removed¶
(if present) Datastructure representing what’s been removed since last commit.
- url¶
Canonical URL for this commit.
- committed_date¶
Date committed.
- parents¶
List of parents for this commit.
(If present) Datastructure representing what’s been added since last commit.
- class github2.commits.Commits(type)[source]¶
GitHub API commits functionality.
Examples¶
Listing Commits on a Branch¶
>>> commits = github.commits.list("mojombo/grit", "master")
By default the first page of results is returned, you can return further results with the page parameter:
>>> commits = github.commits.list("mojombo/grit", "master", page=2)
Listing Commits for a File¶
>>> commits = github.commits.list("mojombo/grit", "master",
... file="grit.gemspec")
Showing a Specific Commit¶
>>> commit = github.commits.show("mojombo/grit",
... sha="5071bf9fbfb81778c456d62e111440fdc776f76c")