Skip to content

Edit a repository's properties. Only fields that are set will be changed.

PATCH
/repos/{owner}/{repo}
owner
required
string

Owner of the repo to edit

repo
required
string

Name of the repo to edit

Properties of a repo that you can edit

EditRepoOption options when editing a repository’s properties

object
allow_fast_forward_only_merge

Either true to allow fast-forward-only merging pull requests, or false to prevent fast-forward-only merging.

boolean
allow_manual_merge

Either true to allow mark pr as merged manually, or false to prevent it.

boolean
allow_merge_commits

Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits.

boolean
allow_rebase

Either true to allow rebase-merging pull requests, or false to prevent rebase-merging.

boolean
allow_rebase_explicit

Either true to allow rebase with explicit merge commits (–no-ff), or false to prevent rebase with explicit merge commits.

boolean
allow_rebase_update

Either true to allow updating pull request branch by rebase, or false to prevent it.

boolean
allow_squash_merge

Either true to allow squash-merging pull requests, or false to prevent squash-merging.

boolean
archived

Set to true to archive this repository.

boolean
autodetect_manual_merge

Either true to enable AutodetectManualMerge, or false to prevent it. Note: In some special cases, misjudgments can occur.

boolean
default_allow_maintainer_edit

Set to true to allow edits from maintainers by default

boolean
default_branch

Sets the default branch for this repository.

string
default_delete_branch_after_merge

Set to true to delete pr branch after merge by default

boolean
default_merge_style

Set to a merge style to be used by this repository: “merge”, “rebase”, “rebase-merge”, “squash”, “fast-forward-only”, “manually-merged”, or “rebase-update-only”.

string
default_update_style

Set to a update style to be used by this repository: “rebase” or “merge”

string
description

A short description of the repository.

string
enable_prune

Enable prune - remove obsolete remote-tracking references when mirroring

boolean
external_tracker

ExternalTracker represents settings for external tracker

object
external_tracker_format

External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.

string
external_tracker_regexp_pattern

External Issue Tracker issue regular expression

string
external_tracker_style

External Issue Tracker Number Format, either numeric, alphanumeric, or regexp

string
external_tracker_url

URL of external issue tracker.

string
external_wiki

ExternalWiki represents setting for external wiki

object
external_wiki_url

URL of external wiki.

string
globally_editable_wiki

Set the globally editable state of the wiki

boolean
has_actions

Either true to enable actions unit, or false to disable them.

boolean
has_issues

Either true to enable issues for this repository or false to disable them.

boolean
has_packages

Either true to enable packages unit, or false to disable them.

boolean
has_projects

Either true to enable project unit, or false to disable them.

boolean
has_pull_requests

Either true to allow pull requests, or false to prevent pull request.

boolean
has_releases

Either true to enable releases unit, or false to disable them.

boolean
has_wiki

Either true to enable the wiki for this repository or false to disable it.

boolean
ignore_whitespace_conflicts

Either true to ignore whitespace for conflicts, or false to not ignore whitespace.

boolean
internal_tracker

InternalTracker represents settings for internal tracker

object
allow_only_contributors_to_track_time

Let only contributors track time (Built-in issue tracker)

boolean
enable_issue_dependencies

Enable dependencies for issues and pull requests (Built-in issue tracker)

boolean
enable_time_tracker

Enable time tracking (Built-in issue tracker)

boolean
mirror_interval

Set to a string like 8h30m0s to set the mirror interval time

string
name

Name of the repository

string
unique items
private

Either true to make the repository private or false to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private.

boolean
template

Either true to make this repository a template or false to make it a normal repository

boolean
website

A URL with more information about the repository.

string
wiki_branch

Sets the branch used for this repository’s wiki.

string
Example generated
{
"allow_fast_forward_only_merge": true,
"allow_manual_merge": true,
"allow_merge_commits": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_rebase_update": true,
"allow_squash_merge": true,
"archived": true,
"autodetect_manual_merge": true,
"default_allow_maintainer_edit": true,
"default_branch": "example",
"default_delete_branch_after_merge": true,
"default_merge_style": "example",
"default_update_style": "example",
"description": "example",
"enable_prune": true,
"external_tracker": {
"external_tracker_format": "example",
"external_tracker_regexp_pattern": "example",
"external_tracker_style": "example",
"external_tracker_url": "example"
},
"external_wiki": {
"external_wiki_url": "example"
},
"globally_editable_wiki": true,
"has_actions": true,
"has_issues": true,
"has_packages": true,
"has_projects": true,
"has_pull_requests": true,
"has_releases": true,
"has_wiki": true,
"ignore_whitespace_conflicts": true,
"internal_tracker": {
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true,
"enable_time_tracker": true
},
"mirror_interval": "example",
"name": "example",
"private": true,
"template": true,
"website": "example",
"wiki_branch": "example"
}

Repository

Media type application/json

Repository represents a repository

object
allow_fast_forward_only_merge
boolean
allow_merge_commits
boolean
allow_rebase
boolean
allow_rebase_explicit
boolean
allow_rebase_update
boolean
allow_squash_merge
boolean
archived
boolean
archived_at
string format: date-time
avatar_url
string
clone_url
string
created_at
string format: date-time
default_allow_maintainer_edit
boolean
default_branch
string
default_delete_branch_after_merge
boolean
default_merge_style
string
default_update_style
string
description
string
empty
boolean
external_tracker

ExternalTracker represents settings for external tracker

object
external_tracker_format

External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.

string
external_tracker_regexp_pattern

External Issue Tracker issue regular expression

string
external_tracker_style

External Issue Tracker Number Format, either numeric, alphanumeric, or regexp

string
external_tracker_url

URL of external issue tracker.

string
external_wiki

ExternalWiki represents setting for external wiki

object
external_wiki_url

URL of external wiki.

string
fork
boolean
forks_count
integer format: int64
full_name
string
globally_editable_wiki
boolean
has_actions
boolean
has_issues
boolean
has_packages
boolean
has_projects
boolean
has_pull_requests
boolean
has_releases
boolean
has_wiki

Is the wiki enabled

boolean
has_wiki_contents

Have wiki pages ever been created

boolean
html_url
string
id
integer format: int64
ignore_whitespace_conflicts
boolean
internal
boolean
internal_tracker

InternalTracker represents settings for internal tracker

object
allow_only_contributors_to_track_time

Let only contributors track time (Built-in issue tracker)

boolean
enable_issue_dependencies

Enable dependencies for issues and pull requests (Built-in issue tracker)

boolean
enable_time_tracker

Enable time tracking (Built-in issue tracker)

boolean
language
string
languages_url
string
link
string
mirror
boolean
mirror_interval
string
mirror_updated
string format: date-time
name
string
object_format_name

ObjectFormatName of the underlying git repository

string
Allowed values: sha1 sha256
open_issues_count
integer format: int64
open_pr_counter
integer format: int64
original_url
string
owner

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s profile page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
pronouns

The user’s pronouns

string
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
parent
object recursive
permissions

Permission represents a set of permissions

object
admin
boolean
pull
boolean
push
boolean
private
boolean
release_counter
integer format: int64
repo_transfer

RepoTransfer represents a pending repo transfer

object
doer

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s profile page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
pronouns

The user’s pronouns

string
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
recipient

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s profile page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
pronouns

The user’s pronouns

string
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
teams
Array<object>

Team represents a team in an organization

object
can_create_org_repo
boolean
description
string
id
integer format: int64
includes_all_repositories
boolean
name
string
organization

Organization represents an organization

object
avatar_url
string
created
string format: date-time
description
string
email
string
full_name
string
id
integer format: int64
location
string
name
string
repo_admin_change_team_access
boolean
username

Deprecated

string
visibility
string
website
string
permission
string
Allowed values: none read write admin owner
units
Array<string>
units_map
object
key
additional properties
string
size
integer format: int64
ssh_url
string
stars_count
integer format: int64
template
boolean
topics
Array<string>
updated_at
string format: date-time
url
string
watchers_count
integer format: int64
website
string
wiki_branch
string
wiki_clone_url
string
wiki_ssh_url
string
Example
{
"object_format_name": "sha1",
"owner": {
"login_name": "empty"
},
"repo_transfer": {
"doer": {
"login_name": "empty"
},
"recipient": {
"login_name": "empty"
},
"teams": [
{
"permission": "none",
"units": [
"repo.code",
"repo.issues",
"repo.ext_issues",
"repo.wiki",
"repo.pulls",
"repo.releases",
"repo.projects",
"repo.ext_wiki"
],
"units_map": {
"repo.actions": "none",
"repo.code": "read",
"repo.ext_issues": "none",
"repo.ext_wiki": "none",
"repo.issues": "write",
"repo.packages": "none",
"repo.projects": "none",
"repo.pulls": "owner",
"repo.releases": "none",
"repo.wiki": "admin"
}
}
]
}
}

APIForbiddenError is a forbidden error response

Media type application/json
object
message
string
url
string
Example generated
{
"message": "example",
"url": "example"
}

APINotFound is a not found error response

Media type application/json
object
errors
Array<string>
message
string
url
string
Example generated
{
"errors": [
"example"
],
"message": "example",
"url": "example"
}

APIValidationError is error format response related to input validation

Media type application/json
object
message
string
url
string
Example generated
{
"message": "example",
"url": "example"
}