Merge Request Target Branch

Hello Everyone

The company I work for recently moved to GitLab and it has fallen to me and a colleague to set the installation up and get it working how we want it. We are having problems when a user creates a merge request, the target branch is always master.

Let me give you a bit of background about how we operate:

We create a release branch from our pre_production branch with follows the format release__<release_date>

We then create the individual task branches from this release branch and these take the format of TASK-<ticket_number>

When the tasks are completed they are merged into the release branch (the branch it was based on)

Then we have the upstream stuff that leads finally to production (master)

The problem I am having is when the developer who completed the task puts in a merge request, the merge request defaults to have the merge target as master when we would like it to default to the release branch the task branch was created from. Is there any possible way to do this

Unfortunately due to the number of devs on the team and the fact they are distributed all over the place its not practical for me just to tell them to make sure they target the correct branch as mistakes are going to be made.

I would imagine we have the enterprise license so I think all features will be available with out license.

I thank you all in advance for your assistance.

Hi,

Personally I don’t see how you can do this, at least not automatically. You would have to go to the Project and then in Settings → Repository and under default branch, manually change it to the release branch that you are working on. As at present, I expect this will be set to master.

And you would need to do this every time you create a new release branch.

1 Like