Mirror specific branches only

Release notes

Now, you can also choose to mirror specific branches only. This is helpful when different parties collaborate on a project but each work in their own repositories. They can then use specific branches to communicate their respective changes towards each other without directly pushing to the main branch of the other. This way each party controls which changes of the other party are merged into their own main branch.

So far, you could only choose to mirror an entire repository or just the protected branches.

image

https://docs.gitlab.com/ee/user/project/repository/mirror/#mirror-specific-branches

Problem

Zendesk: https://gitlab.zendesk.com/agent/tickets/68186

It would be great to be able to choose one or more specific branches to be mirrored rather than the whole repository. This has many use-cases. In one example, a project fork could mirror only the master branch to keep their fork up to date. In the customer's case they're working with 3rd parties that are on GitHub. They would like to accept contributions on GitHub and have a particular branch mirrored to GitLab.

Customers

customer contact
https://gitlab.zendesk.com/agent/tickets/161442 @swainaina
https://gitlab.my.salesforce.com/0014M00002BzZfL?srPos=0&srKp=001

Availability and Testing

Add feature spec to ensure that push and pull mirrors, only mirror protected branches matching a given regex

Edited by Torsten Linz