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 is false. πŸ‘€
  • --direction="pull" β€” sets the mirror direction. Options: pull, push. The default shown is pull. 🧭
  • --enabled[=true] β€” determines if the mirror is enabled. The default shown is true. βœ…
  • --protected-branches-only[=false] β€” determines if only protected branches are mirrored. The default shown is false. 🌿
  • --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 is false. 🫢

🌸 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