glab-repo-mirror - Man Page

Configure mirroring on an existing project to sync with a remote repository.

Synopsis

glab repo mirror [ID | URL | PATH] [flags]

Description

Configure repository mirroring for an existing GitLab project.

The GitLab project must already exist. This command configures mirroring on existing projects but does not create new projects.

Mirror types:

Authentication:

Options

--allow-divergence[=false] Determines if divergent refs are skipped.

--direction="pull" Mirror direction. Options: pull, push.

--enabled[=true] Determines if the mirror is enabled.

--protected-branches-only[=false] Determines if only protected branches are mirrored.

--url="" The target URL to which the repository is mirrored.

Options Inherited from Parent Commands

-h, --help[=false] Show help for this command.

Example

# Create a project, then configure pull mirroring
$ glab repo create mygroup/myproject --public
$ glab repo mirror mygroup/myproject --direction=pull --url="https://gitlab.example.com/org/repo"

# Configure pull mirroring from a private repository
$ glab repo mirror mygroup/myproject --direction=pull --url="https://username:token@gitlab.example.com/org/private-repo"

# Configure pull mirroring for protected branches only
$ glab repo mirror mygroup/myproject --direction=pull --url="https://gitlab.example.com/org/repo" --protected-branches-only

# Configure push mirroring to another GitLab instance
$ glab repo mirror mygroup/myproject --direction=push --url="https://gitlab-backup.example.com/backup/myproject"

# Configure push mirroring and allow divergent refs
$ glab repo mirror mygroup/myproject --direction=push --url="https://gitlab-backup.example.com/backup/repo" --allow-divergence

See Also

glab-repo(1)

Referenced By

glab-repo(1).

Jan 2026 Auto generated by spf13/cobra