Updated on 2025-09-23 GMT+08:00

Synchronizing a Repository

If you import an external repository and need to synchronize the source repository data, perform the operations in this section.

Constraints

Table 1 Constraints on synchronizing repositories

Item

Description

Function constraint

The current repository is imported.

Permission constraint

You have the set permission on the repository.

Configuring a Repository to Be Synchronized

  1. As shown in the following figure, click Settings in the navigation bar (you have the set permission) and choose Repository Management > Repository Synchronization in the navigation pane.

  2. Set parameters according to Table 2 Parameters for synchronizing repositories . The following table uses the GitLab repository import as an example.

    Table 2 Parameters for synchronizing repositories

    Parameter

    Description

    Example

    Source Repository URL

    Path of the repository to be imported. The source repository path must start with http:// or https:// and end with .git.

    If the source repository address changes, you can enter the source repository address again.

    https://gitlab.com/example.git

    Sync Branch

    The options are as follows:

    • Default branch. The master branch automatically created when a code repo is created, for example, the master branch.
    • All branches. All branches in the code repo, including the default branch and other custom branches.

    Select Default branch.

    Associate Service Endpoint

    Optional.

    • Select Git repository. This parameter applies to all imported repositories. Select Git repository from the first drop-down list and select an endpoint instance from the second drop-down list.
    • GitHub: This parameter applies only to GitHub repositories. Select GitHub from the first drop-down list and select an endpoint instance from the second drop-down list.

    If you need to create an endpoint, create one by referring to Verifying Permissions Through Service Endpoints.

    Select Git repositories from the first drop-down list and select the created endpoint instance Test from the second drop-down list.

  3. You can select a repository data synchronization mode based on your requirements by referring to Table 3 Synchronization parameters.

    Table 3 Synchronization parameters

    Parameter

    Description

    Manual

    If you click Synchronize Repository, the following dialog box is displayed:

    • If you want to forcibly synchronize the source repository content, select Force sync.
    • Verification to Access Source Repo
    WARNING:
    • Syncing a source repository may overwrite your committed code. Exercise caution when performing this operation.
    • Max interval between manual syncs: 10 minutes

    Scheduled

    This function is disabled by default. You can enable it as needed. After this function is enabled, the repository is updated every 24 hours. The latest content is the source repository's content 24 hours ago.

    CAUTION:

    Enabling this will limit the repositories to read-only status (no code commits or uploads).