version v7.2.
For up-to-date documentation, see the
latest version.
GitLab mirroring
2 minute read
Overview
A pull mirror in GitLab allows you to keep a GitLab repository synchronized with a remote repository by regularly pulling in changes from the source. This is useful for keeping a copy of an external project updated within your GitLab instance, or for backing up your own repositories to a separate location.
For detailed information, refer to the official GitLab Mirror Pull .
How to set up a pull mirror
Accessing Mirror Settings
You can configure a pull mirror in two ways:
- During Project Import: When importing a project, you’ll find the mirroring options within the import settings.
- Project Configuration: For existing projects, navigate to your project’s Settings > Repository > Mirroring repositories.
Note: Project owners can configure mirroring, except on RTDP instances.
Configuring the Pull Mirror
- Git repository URL: Provide the URL of the remote repository you want to mirror.
- Mirror direction: Select “Pull” to indicate that changes should be pulled from the remote repository into your GitLab repository.
- Authentication: If the remote repository requires authentication, provide the necessary credentials (username/password or SSH key).
- Trigger: While changes are automatically pulled every 30 minutes, you can also trigger updates
manually through the following methods:
- An administrator can manually force an update of the mirror.
- Trigger an update programmatically using the GitLab API.
Network Considerations
Ensure that a network route is open between your GitLab instance and the remote repository. Refer to the Platform documentation for details on current network possibilities and any restrictions that may apply.
Key Points to Remember
- The 30-minute automatic pull interval cannot be disabled.
- Pulling changes only updates your GitLab repository; it does not push any changes back to the remote repository.
- If you need more frequent updates or two-way synchronization, consider using a push mirror or alternative synchronization methods.