git.repositories.update

Change description, visibility, default branch or archive state

PATCH /git/api/repositories/{repoId}IAM git:UpdateRepositoryChanges stateDestructive

Request syntax

PATCH /git/api/repositories/{repoId}
{
  "description": "string",
  "homepage": "string",
  "topics": "array of string",
  "visibility": "enum",
  "defaultBranch": "string",
  "isArchived": "boolean",
  "allowMergeCommit": "boolean",
  "allowSquashMerge": "boolean",
  "allowRebaseMerge": "boolean",
  "deleteBranchOnMerge": "boolean",
  "defaultWorkflowPermissions": "enum"
}

Path parameters

  • repoIdRequired

    string

    Constraints: uuid

Request body

  • descriptionOptional

    string

    One line about the repository, shown in lists and the About column

    Constraints: max 500 chars

  • homepageOptional

    string

    The About link (http or https); null removes it

    Constraints: url, max 300 chars

    May be null.

  • topicsOptional

    array of string

    Topics: lowercase letters, digits and hyphens, at most 20

    Constraints: /^[a-z0-9][a-z0-9-]{0,49}$/

  • visibilityOptional

    enum

    Who can see it; making it public also needs git:PublishRepository

    One of: private, internal, public

  • defaultBranchOptional

    string

    The branch clones check out and pull requests target by default

    Constraints: 1-100 chars

  • isArchivedOptional

    boolean

    true archives it (read-only: pushes, merges and edits refused); false unarchives

  • allowMergeCommitOptional

    boolean

    Pull requests may merge with a merge commit

  • allowSquashMergeOptional

    boolean

    Pull requests may be squash-merged

  • allowRebaseMergeOptional

    boolean

    Pull requests may be rebase-merged

  • deleteBranchOnMergeOptional

    boolean

    Delete the source branch when a pull request is merged

  • defaultWorkflowPermissionsOptional

    enum

    What a workflow job's GITHUB_TOKEN may do when its file sets no `permissions:`: restricted (contents and packages read; new repositories) or permissive (read and write)

    One of: restricted, permissive

Response

200 with the repository after the change (its `cloneUrl` is null in this answer). 400 when the change would leave no merge method allowed.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • idAlways

    string

    The repository id
  • orgIdAlways

    string

    The organization it belongs to
  • nameAlways

    string

    Its name, unique in the organization and part of the clone URL
  • descriptionAlways

    string, may be null

    One line about it; null when none
  • homepageAlways

    string, may be null

    The About link; null when none
  • topicsAlways

    array of string

    Its topics
  • visibilityAlways

    one of private, internal, public

    Who can see it
  • defaultBranchAlways

    string

    The branch clones check out and pull requests target by default
  • isEmptyAlways

    boolean

    Nothing has been pushed yet
  • isArchivedAlways

    boolean

    Read-only: pushes, merges and edits are refused
  • allowMergeCommitAlways

    boolean

    Pull requests may merge with a merge commit
  • allowSquashMergeAlways

    boolean

    Pull requests may be squash-merged
  • allowRebaseMergeAlways

    boolean

    Pull requests may be rebase-merged
  • deleteBranchOnMergeAlways

    boolean

    A merged pull request's source branch is deleted
  • sizeBytesAlways

    number

    Stored size in bytes, what storage is billed on
  • refsVersionAlways

    number

    A counter that grows each time a branch or tag moves
  • lastPushedAtAlways

    string, may be null

    When the last push landed (ISO 8601); null before the first
  • importStateAlways

    object, may be null

    The import or fork copy that filled the repository; null for one created empty
  • importState.​statusAlways

    one of queued, running, succeeded, failed

    Where the import stands
  • importState.​providerAlways

    one of github, gitlab, git

    Where it comes from: GitHub, GitLab, or any git URL
  • importState.​sourceUrlAlways

    string

    The source as given, without credentials
  • importState.​includeAlways

    object

    What was asked for besides the git history
  • importState.​include.​pullRequestsAlways

    boolean

    Pull requests are brought over
  • importState.​include.​wikiAlways

    boolean

    The wiki is brought over as repository {name}.wiki
  • importState.​include.​pullRequestLimitWhen present

    number

    At most this many pull requests, newest first
  • importState.​pullsWhen present

    object

    The pull requests' progress; absent until the import reaches them
  • importState.​pulls.​totalAlways

    number, may be null

    Pull requests the source has, in all states; null when it does not say
  • importState.​pulls.​importedAlways

    number

    Pull requests imported so far
  • importState.​pulls.​limitAlways

    number

    At most this many are imported
  • importState.​pulls.​backfillAlways

    one of running, done, failed

    The background import of the older closed pull requests
  • importState.​pulls.​nextClosedPageAlways

    number, may be null

    The page of the source's closed pull requests read next; null when done
  • importState.​pulls.​errorAlways

    string, may be null

    Why the background import failed; null if not
  • importState.​importerIamUserIdAlways

    string, may be null

    The IAM user who started it; imported pull requests are written as them
  • importState.​startedAtAlways

    string, may be null

    When it started (ISO 8601); null while queued
  • importState.​finishedAtAlways

    string, may be null

    When it ended (ISO 8601); null until then
  • importState.​errorAlways

    string, may be null

    Why it failed; null unless it did
  • importState.​importedAlways

    object, may be null

    What came over; null until the import finished
  • importState.​imported.​branchesAlways

    number

    Branches brought over
  • importState.​imported.​tagsAlways

    number

    Tags brought over
  • importState.​imported.​pullRequestsAlways

    number

    Pull requests brought over
  • importState.​imported.​wikiRepositoryIdAlways

    string, may be null

    The wiki repository created; null without a wiki
  • importState.​imported.​notesAlways

    array of string

    Remarks on what could not be carried over as is
  • mirrorAlways

    object, may be null

    Set while it mirrors a source (pushes refused); null for an ordinary repository
  • mirror.​providerAlways

    one of github, gitlab, git

    Where it comes from: GitHub, GitLab, or any git URL
  • mirror.​sourceUrlAlways

    string

    The source followed, without credentials
  • mirror.​intervalMinutesAlways

    number

    Minutes between full fetches
  • mirror.​lastSyncedAtAlways

    string, may be null

    When the last sync finished (ISO 8601); null before the first
  • mirror.​lastErrorAlways

    string, may be null

    Why the last sync failed; null when it did not
  • mirror.​pullsUpdatedThroughWhen present

    string

    Pull requests changed on the source up to this time (ISO 8601) are in
  • mirror.​pullsUpdatedAtCorrectedAtWhen present

    string

    When the imported pull requests' update times were taken from the source
  • mirror.​mergeMethodsReadAtWhen present

    string

    When the source's merge methods were last applied here (ISO 8601)
  • mirror.​continuousWhen present

    boolean

    The source is checked every minute and fetched as soon as a ref moved
  • mirror.​shadowCiWhen present

    object

    Running the source's workflows here to compare; absent when never set
  • mirror.​shadowCi.​enabledAlways

    boolean

    Shadow CI runs on mirrored pushes
  • mirror.​shadowCi.​branchesAlways

    array of string

    Branch patterns it runs for; the default branch when empty
  • mirror.​hasTokenAlways

    boolean

    A token for the source is kept (it is never shown)
  • pushMirrorAlways

    object, may be null

    Where every push is copied to; null without a push mirror. The token is never shown
  • pushMirror.​urlAlways

    string

    The remote repository pushes are copied to
  • pushMirror.​lastPushedAtAlways

    string, may be null

    When the last push to it finished (ISO 8601); null before the first
  • pushMirror.​lastStatusAlways

    one of ok, failed, may be null

    How the last push went; null before the first
  • pushMirror.​lastErrorAlways

    string, may be null

    Why the last push failed; null when it did not
  • pushMirror.​rejectedRefsAlways

    array of string

    Refs the remote refused in the last push because they moved there on their own
  • forkedFromRepoIdAlways

    string, may be null

    The repository it was forked from; null for an original or a deleted parent
  • secretPushProtectionAlways

    boolean

    Pushes that add a known credential format are refused
  • dependencyAlertsAlways

    boolean

    Lockfiles on the default branch are checked against the vulnerability database
  • maxFileSizeMbAlways

    number, may be null

    Largest file a push may add, in MB; null for the platform default of 100
  • defaultWorkflowPermissionsAlways

    one of restricted, permissive

    What a workflow job's token may do when its file sets no `permissions:`
  • createdAtAlways

    string

    When it was created (ISO 8601)
  • updatedAtAlways

    string

    When its settings last changed (ISO 8601)
  • cloneUrlAlways

    string, may be null

    The HTTPS clone URL; null in the answer to `update`

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow git:UpdateRepository on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud git repositories update repoId

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_git_repositories_update.