version v7.2.
For up-to-date documentation, see the
latest version.
Repo Mirroring
2 minute read
Each platform choose their limitation to use this feature. Refer to Service per platform .
Software Factory recommends that only platform admins have the privilege to create Mirrors.
GitLab mirroring is a feature that allows you to keep a duplicate of your Git repository in sync with the original repository.
Think of it as a live backup that is continuously updated with every change made to your main project. This “mirror” can reside on another GitLab instance, a server you manage yourself, or on other platforms like GitHub or Bitbucket.
Types of Mirroring
Push Mirroring
Push mirroring allows GitLab to push changes to an external repository.
When to use it: Use push mirroring when you want to maintain or share a repository across more restricted platforms (e.g., from C2 to C3).
Mirroring repositories from restricted environments to less restricted ones is prohibited.
Pull Mirroring
Pull mirroring allows GitLab to pull changes from an external repository.
When to use it: Use pull mirroring when the external repository is the source of truth and you need to integrate its changes.
Always verify that external repositories are trusted and their content is properly verified before pulling.
Issues, merge requests, CI/CD pipelines and settings doesn’t get mirrored.
Authentication
- Deploy Tokens (automated systems due to limited scope)
- SSH public keys (ecommended for enhanced security)
- Password (HTTPS username/password authentication)
- Personal Access Tokens (grants broader permissions)
Benefits of GitLab Repository Mirroring
Redundancy and Backup:
- It provides a continuous, up-to-date backup of your repository, ensuring that your valuable codebase is always safe and recoverable.
Collaboration with External Partners:
- Mirroring helps in securely sharing code with external collaborators.
- You can grant access to the mirrored copy without exposing your primary repository, offering a layer of security and control.
Load Distribution:
- By distributing load across multiple mirrors, you can improve performance and accessibility for geographically dispersed teams.
- Configuration Flexibility:
- You can set up mirroring with various external repositories, and mirroring can be configured to handle both private and public repositories.
If you are interested in implementing this feature in your Software Factory, you can refer to How to create a pull mirror ? .
For detailed information about GitLab mirroring, refer to the official GitLab repository mirroring