commits
Accessed as client.repos.git.commits; the async client mirrors it.
ReposGitCommits
The repos.git.commits namespace.
download
download(owner: str, repo: str, sha: str, diff_type: Literal['diff', 'patch']) -> str
Get a commit's diff or patch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
sha
|
str
|
SHA of the commit to get |
required |
diff_type
|
Literal['diff', 'patch']
|
whether the output is diff or patch |
required |
Returns:
| Type | Description |
|---|---|
str
|
APIString is a string response. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoDownloadCommitDiffOrPatch
get
get(
owner: str,
repo: str,
sha: str,
*,
stat: bool | None = None,
verification: bool | None = None,
files: bool | None = None,
) -> Commit
Get a single commit from a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
sha
|
str
|
a git ref or commit sha |
required |
stat
|
bool | None
|
include diff stats for every commit (disable for speedup, default 'true') |
None
|
verification
|
bool | None
|
include verification for every commit (disable for speedup, default 'true') |
None
|
files
|
bool | None
|
include a list of affected files for every commit (disable for speedup, default 'true') |
None
|
Returns:
| Type | Description |
|---|---|
Commit
|
Commit. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
UnprocessableEntityError
|
|
Operation ID: repoGetSingleCommit
AsyncReposGitCommits
The repos.git.commits namespace.
download
download(owner: str, repo: str, sha: str, diff_type: Literal['diff', 'patch']) -> str
Get a commit's diff or patch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
sha
|
str
|
SHA of the commit to get |
required |
diff_type
|
Literal['diff', 'patch']
|
whether the output is diff or patch |
required |
Returns:
| Type | Description |
|---|---|
str
|
APIString is a string response. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoDownloadCommitDiffOrPatch
get
get(
owner: str,
repo: str,
sha: str,
*,
stat: bool | None = None,
verification: bool | None = None,
files: bool | None = None,
) -> Commit
Get a single commit from a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
sha
|
str
|
a git ref or commit sha |
required |
stat
|
bool | None
|
include diff stats for every commit (disable for speedup, default 'true') |
None
|
verification
|
bool | None
|
include verification for every commit (disable for speedup, default 'true') |
None
|
files
|
bool | None
|
include a list of affected files for every commit (disable for speedup, default 'true') |
None
|
Returns:
| Type | Description |
|---|---|
Commit
|
Commit. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
UnprocessableEntityError
|
|
Operation ID: repoGetSingleCommit