provider repos POST /repos/{template_owner}/{template_repo}/generate
@utdk/github /repos/{template_owner}/{template_repo}/generate
Create a repository using a template
Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
template_owner path required
The account owner of the template repository. The name is not case sensitive.
string
template_repo path required
The name of the template repository without the `.git` extension. The name is not case sensitive.
string

Try it

Authentication
Configure credentials for GitHub v3 REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

repos.createUsingTemplate
POST/repos/{template_owner}/{template_repo}/generate
Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.

Parameters

required

The account owner of the template repository. The name is not case sensitive.

required

The name of the template repository without the `.git` extension. The name is not case sensitive.

Input

The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization.

required

The name of the new repository.

A short description of the new repository.

Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`.

Either `true` to create a new private repository or `false` to create a new public one.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import github from '@utdk/github';

await github.repos.createUsingTemplate({
  "include_all_branches": false,
  "private": false
})