repository

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

Changed on
patch/repos/{owner}/{repo}

Request

  • Base URL
    https://demo.gitea.com/api/v1
  • Auth
    • HTTP basic
    • or API key in query parameter token
    • or API key in query parameter access_token
    • or API key in header Authorization
    • or API key in query parameter sudo
    • or API key in header Sudo
    • or API key in header X-GITEA-OTP
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

ownerstring required

owner of the repo to edit

repostring required

name of the repo to edit

Request body

allow_fast_forward_only_mergeboolean

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

allow_manual_mergeboolean

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

allow_merge_commitsboolean

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

allow_merge_updateboolean

either true to allow updating pull request branch by merge, or false to prevent it.

allow_rebaseboolean

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

allow_rebase_explicitboolean

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

allow_rebase_updateboolean

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

allow_squash_mergeboolean

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

archivedboolean

set to true to archive this repository.

autodetect_manual_mergeboolean

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

default_allow_maintainer_editboolean

set to true to allow edits from maintainers by default

default_branchstring

sets the default branch for this repository.

default_delete_branch_after_mergeboolean

set to true to delete pr branch after merge by default

default_merge_stylestring

set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", "squash", or "fast-forward-only".

default_update_stylestring

set to an update style to be used by this repository: "merge" or "rebase".

descriptionstring

a short description of the repository.

enable_pruneboolean

enable prune - remove obsolete remote-tracking references when mirroring

has_actionsboolean

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

has_codeboolean

either true to enable code for this repository or false to disable it.

has_issuesboolean

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

has_packagesboolean

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

has_projectsboolean

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

has_pull_requestsboolean

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

has_releasesboolean

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

has_wikiboolean

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

ignore_whitespace_conflictsboolean

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

mirror_intervalstring

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

mirror_passwordstring

authentication password for the remote repository (mirrors)

mirror_tokenstring

authentication token for the remote repository (mirrors)

mirror_usernamestring

authentication username for the remote repository (mirrors)

namestring

name of the repository

privateboolean

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.

projects_modestring

repo to only allow repo-level projects, owner to only allow owner projects, all to allow both.

squash_merge_commit_messagestring

set the default squash merge commit message body: "PR_BODY", "COMMIT_MESSAGES", or "BLANK".

templateboolean

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

websitestring

a URL with more information about the repository.

Response

Repository

allow_fast_forward_only_mergeboolean
allow_manual_mergeboolean
allow_merge_commitsboolean
allow_merge_updateboolean
allow_rebaseboolean
allow_rebase_explicitboolean
allow_rebase_updateboolean
allow_squash_mergeboolean
archivedboolean
archived_atstring date-time
autodetect_manual_mergeboolean
avatar_urlstring
branch_countinteger
clone_urlstring
created_atstring date-time
default_allow_maintainer_editboolean
default_branchstring
default_delete_branch_after_mergeboolean
default_merge_stylestring
default_target_branchstring
default_update_stylestring
descriptionstring
emptyboolean
forkboolean
forks_countinteger
full_namestring
has_actionsboolean
has_codeboolean
has_issuesboolean
has_packagesboolean
has_projectsboolean
has_pull_requestsboolean
has_releasesboolean
has_wikiboolean
html_urlstring
idinteger
ignore_whitespace_conflictsboolean
internalboolean
languagestring
languages_urlstring
licensesstring[]
linkstring
mirrorboolean
mirror_intervalstring
mirror_last_sync_atstring date-time
mirror_updatedstring date-time
namestring
object_format_name'sha1' | 'sha256'

ObjectFormatName of the underlying git repository

open_issues_countinteger
open_pr_counterinteger
original_urlstring
parentRepository circular
privateboolean
projects_modestring
release_counterinteger
sizeinteger
squash_merge_commit_messagestring
ssh_urlstring
stars_countinteger
templateboolean
topicsstring[]
updated_atstring date-time
urlstring
watchers_countinteger
websitestring

Example response

{
  "repo_transfer": {
    "teams": [
      {
        "units": [
          "repo.code",
          "repo.issues",
          "repo.ext_issues",
          "repo.wiki",
          "repo.pulls",
          "repo.releases",
          "repo.projects",
          "repo.ext_wiki"
        ],
        "units_map": {
          "repo.code": "read",
          "repo.ext_issues": "none",
          "repo.ext_wiki": "none",
          "repo.issues": "write",
          "repo.projects": "none",
          "repo.pulls": "owner",
          "repo.releases": "none",
          "repo.wiki": "admin"
        }
      }
    ]
  }
}

Changes

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status