dcloud git repositories import

Import a repository from GitHub, GitLab or a git URL, optionally as a mirror

IAM git:CreateRepositoryChanges state

Answers 202 with the new repository; `importState.status` goes queued → running → succeeded/failed, with counts of branches, tags and pull requests. History, branches, tags, pull requests (as pull requests here, original author and link in the body) and the wiki (as `{name}.wiki`) come over; issues and releases are not carried over. The fetch runs on the server, so there is no 2 GiB push limit.

Synopsis

dcloud git repositories import --name name --source source [flags]

Flags

  • --nameRequired

    string

    Unique within the organization; part of the clone URL

    Constraints: 1-100 chars, /^[A-Za-z0-9][A-Za-z0-9._-]*$/

  • --descriptionOptional

    string

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

    Constraints: max 500 chars

  • --visibilityOptional

    enum

    Who can see it; private when absent. public also needs git:PublishRepository

    One of: private, public

  • --sourceRequired

    object

    Where to import from: its URL and, optionally, the provider

    Constraints: JSON

  • --tokenOptional

    string

    GitHub/GitLab token for a private source or a higher API limit; kept (sealed) only for a mirror

    Constraints: 1-500 chars

  • --includeOptional

    object

    What comes over besides the git history: pull requests and the wiki (both by default)

    Constraints: JSON

  • --mirrorOptional

    object

    Keep following the source; pushes are refused while it mirrors

    Constraints: JSON

  • --tagsOptional

    map of string

    Tags for the new resource, e.g. {"env": "prod", "project": "shop"}. Keys your organization marks required must be present, or the create is refused with the missing keys (GET /tags/api/keys lists them).

    Constraints: key=value

Example

dcloud git repositories import --name example --source '{}'

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