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 endpoint and check that the is_template
key is true
.
OAuth scope requirements
When using OAuth , authorizations must include:
public_repo
scope or repo
scope to create a public repository. Note: For GitHub AE, use repo
scope to create an internal repository.
repo
scope to create a private repository Create a repository using a template
Arguments template_owner string string [scalar] API:
Github Open API
(version: 1.1.4)
template_repo string string [scalar] API:
Github Open API
(version: 1.1.4)
Returns 201 application/json repository repository [object] Attributes
Whether to allow Auto-merge to be used on pull requests.
Whether to allow forking this repo
Whether to allow merge commits for pull requests.
Whether to allow rebase merges for pull requests.
Whether to allow squash merges for pull requests.
Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.
Whether anonymous git access is enabled for this repository
Whether the repository is archived.
The default branch of the repository.
Whether to delete head branches when pull requests are merged
Returns whether or not this repository disabled.
Whether discussions are enabled.
Whether downloads are enabled.
Whether issues are enabled.
Whether projects are enabled.
Whether the wiki is enabled.
Unique identifier of the repository
Whether this repository acts as a template that can be used to generate new repositories.
The default value for a merge commit message.
PR_TITLE
- default to the pull request's title.
PR_BODY
- default to the pull request's body.
BLANK
- default to a blank commit message.
The default value for a merge commit title.
PR_TITLE
- default to the pull request's title.
MERGE_MESSAGE
- default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
The name of the repository.
Whether the repository is private or public.
The size of the repository. Size is calculated hourly. When a repository is initially created, the size is 0.
squash_merge_commit_message string
The default value for a squash merge commit message:
PR_BODY
- default to the pull request's body.
COMMIT_MESSAGES
- default to the branch's commit messages.
BLANK
- default to a blank commit message.
squash_merge_commit_title string
The default value for a squash merge commit title:
PR_TITLE
- default to the pull request's title.
COMMIT_OR_PR_TITLE
- default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
use_squash_pr_title_as_default boolean
Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use squash_merge_commit_title
instead.
The repository visibility: public, private, or internal.
web_commit_signoff_required boolean
Whether to require contributors to sign off on web-based commits
API:
Github Open API
(version: 1.1.4)
API:
Github Open API
(version: 1.1.4)