glab(1)
πͺ NAME πͺ
okay so bestie, welcome to the glab(1) manual β this page is all about glab-repo-mirror, aka the command that configures mirroring on an existing project so it can sync with a remote repository. β¨
π‘ SYNOPSIS π‘
glab repo mirror [] [flags]
π« DESCRIPTION π«
This command configures repository mirroring for an existing GitLab project. No cap.
The GitLab project must already exist. This command configures mirroring on existing projects but does not create new projects. So like, if you were hoping it would spawn a fresh project for you? It won't, bestie. π
π Mirror types
- Pull mirror β syncs changes from an external repository to your GitLab project. The external repository is the source of truth. Use pull mirrors to sync from GitHub, Bitbucket, or other GitLab instances. π«Ά
- Push mirror β syncs changes from your GitLab project to an external repository. Your GitLab project is the source of truth. Use push mirrors to sync to GitHub, Bitbucket, or other GitLab instances. π
π Authentication
- For pull mirrors from private repositories, embed credentials in the URL:
https://username:token@gitlab.example.com/org/repoβ yes, literally in the URL. π - For push mirrors to private repositories, configure credentials in the GitLab UI or use SSH URLs with deploy keys. iykyk π
β¨ OPTIONS β¨
--allow-divergence[=false]β determines if divergent refs are skipped. The default shown isfalse. π--direction="pull"β sets the mirror direction. Options:pull,push. The default shown ispull. π§--enabled[=true]β determines if the mirror is enabled. The default shown istrue. β--protected-branches-only[=false]β determines if only protected branches are mirrored. The default shown isfalse. πΏ--url=""β the target URL to which the repository is mirrored. The default shown is"". π
𧬠OPTIONS INHERITED FROM PARENT COMMANDS π§¬
-h,--help[=false]β show help for this command. The default shown isfalse. π«Ά
πΈ 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)β go say hi to the parent repo page, bestie. π«Ά
okay thatβs the whole page β it was auto generated by spf13/cobra, dated Nov 2026, and itβs part of the glab(1) manual. mwah πβ¨
π¦ where this page comes from
- arch rolling: glab 1.128.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms