gitgitlabgitlab-cigitlab-7

Gitlab: Is it possible to create a merge request from MY fork to Another fork of the same project


Scenario: we are 3 developers.

Developer 1 (admin) created the main repo.

Developer 2 forked admin's repo.

Developer 3 forked admin's repo.

Developer 2 created a feature branch "Feature 1"

Developer 3 checked out "Feature 1" from developer 2 repo.

When Developer 3 tries to create a Merge Request he only sees his own and admin's repos.

So I wonder, Is it possible to create a Merge Request to another remote different than my fork's?"

The only work-around I have seen so far is:

Developer 2 pushes the feature branch to admin's repo (through a merge request) and asks the admin to "protect it", then Developer 3 would have to create a merge request to admin's repo as well, the problem with this approach is that Developer 2 loses the ownership of the branch and they will have to create merge requests every time they want to push their changes.

On the other hand, it seems like this feature was added to GitLab but I can't find the official documentation about this feature.


Solution

  • No forks, maybe?

    You may utilise the fact, that merge requests can be made within the same repository. So maybe all three may use the same repository as developers, the admin should set the crucial branches as protected.

    If any change is made, anyone can create a merge request from one branch to another... and anyone can review, discuss, ...