Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the mirroring settings in Gitlab over the API?

I want to change the Gitlab mirroring settings for each of my repositories. Is it possible to do this over the Gitlab API?

The options the Gitlab WebUi allows, are the following: enter image description here

How can I change them via the API?

Remark: This is not the same question as "How can I tell Gitlab to mirror my Github repositories over the API?" as there my question was how to start the mirroring, here I want to know how I can change the mirroring settings.

like image 951
FranzHuber23 Avatar asked Oct 15 '25 18:10

FranzHuber23


1 Answers

On https://docs.gitlab.com/ee/api/projects.html#edit-project there are several parameters to configure the pull mirroring:

> mirror
> mirror_user_id
> mirror_trigger_builds
> only_mirror_protected_branches
> mirror_overwrites_diverged_branches

Note: If your HTTP repository is not publicly accessible, add authentication information to the URL: https://username:[email protected]/group/project.git where password is a public access key with the api scope enabled

Notice that Push mirroring is not yet implemented: https://gitlab.com/gitlab-org/gitlab-ee/issues/7599

like image 171
djuarezg Avatar answered Oct 18 '25 05:10

djuarezg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!