Skip to content

forks

Accessed as client.repos.forks; the async client mirrors it.

ReposForks

The repos.forks namespace.

create

create(owner: str, repo: str, *, name: str | None = None, organization: str | None = None) -> Repository

Fork a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo to fork

required
repo str

name of the repo to fork

required
name str | None

name of the forked repository

None
organization str | None

organization name, if forking into an organization

None

Returns:

Type Description
Repository

Repository.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
ConflictError
  1. The repository with the same name already exists.
PayloadTooLargeError
  1. QuotaExceeded.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: createFork

list

list(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> Paginated[Repository]

List a repository's forks.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
Paginated[Repository]

RepositoryList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: listForks

AsyncReposForks

The repos.forks namespace.

create

create(owner: str, repo: str, *, name: str | None = None, organization: str | None = None) -> Repository

Fork a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo to fork

required
repo str

name of the repo to fork

required
name str | None

name of the forked repository

None
organization str | None

organization name, if forking into an organization

None

Returns:

Type Description
Repository

Repository.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
ConflictError
  1. The repository with the same name already exists.
PayloadTooLargeError
  1. QuotaExceeded.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.

Operation ID: createFork

list

list(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[Repository]

List a repository's forks.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
AsyncPaginated[Repository]

RepositoryList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: listForks