Updated on 2023-05-06 GMT+08:00

Importing an External Repository

You can import a cloud repository to CodeHub or import a CodeHub repository from a region to another region (see Backup). The imported repository is independent of the source repository.

To import an external repository on the CodeHub console, perform the following steps:

  1. Access the repository list page.
  2. Click next to Create Directly and select Import Repository from the drop-down list. The Import Repository page is displayed.

    • An external repository can be a Git remote repository (HTTPS) or SVN repository.
    • The source repository port can be 80, 443, or greater than 1024.
    • Currently, GitHub, Gitee, GitLab, and SVN China source repositories are supported. If the import using other types of source repositories fails, contact technical support to check the source server whitelist.

  3. Enter the source repository path, and enter the username and password for accessing the source repository. (This parameter is not required for open-source repositories.)

  4. Click Next. On the Create Repository page, enter the basic information about the repository.

    Parameter

    Mandatory

    Remarks

    Repository Name

    Yes

    A name contains letters, digits, underscores (_), periods (.), and hyphens (-) and must start with a letter, digit, or underscore (_).

    Description

    No

    Enter the description of your repository.

    Permissions

    No

    The options are as follows:

    • Allow project members to access the repository

      The project manager is automatically set as the repository administrator, and the developer is set as a common repository member. When the two roles are added to the project, they will be automatically synchronized to existing repositories.

    Visibility

    Yes

    The options are as follows:

    • Private

      Onl members of the repository can access the repository or commit code.

    • Public read-only

      The repository is read-only to all visitors. You can select an open source license as the remarks.

    Branch

    Yes

    You can choose to synchronize the default branch or all branches of the source repository.

    Schedule

    No

    Select Schedule sync into repo.

    • The default branch of the source repository is automatically imported to the default branch of the new repository every day.
    • The repository becomes a read-only image repository and cannot be written. In addition, only the branches of the third-party repository corresponding to the default branch of the current repository are synchronized.

    You can synchronize branches manually. In addition, you can also schedule synchronization. This setting cannot be changed after you configure it.

  5. Click OK to import the repository. The repository list page is displayed.
  • The timeout interval for importing a repository is 30 minutes. If the import times out, use the clone/push function on the client.
  • The Git LFS object is not imported.