How to Create a Merge Request in GitLab

The best way to create a merge request is via using the “Create Merge Request” option that GitLab provides. So whenever your code is pushed, look for that button by refreshing the page. Alternatively you can also directly click on New Merge Request option provided on Merge Requests page.

The Merge Request page can be brought by clicking Merge Requests option on the left side bar as shown:

merge request option

Then the things on the page are actually pretty self-explanatory to be honest. However, you don’t want to make a mistake, now, do you?

So without wasting any more time let’s start with learning How to Create a Merge Request in GitLab.

Steps on How to Create a Merge Request in GitLab

Precondition: Precondition is that you have pushed your code on origin using git or any similar tool.

git push

When you have pushed your data to origin, you will notice a blue button titled “Create Merge Request” being shown in Merge Requests tab of your GitLab account.

The message to the left would say “You pushed to origin your blah blah branch just now”.

Step 1: Just click on the Create Merge Request button.

create merge request option

Step 2: In the next screen you will be asked to provide a title for your MR.

title and description

It is here where you have to enter your description of what all things you changed in the code, or what is your test case about. You can tag members that you wish by simply using an ‘@’ followed by their names, so that each one of them get a notification about this MR.

Step 3: Once you are done, you have to select an assignee through the dropdown provided. You can select the member you wish to assign your MR to.

select assignee

You can also alternatively assign it to yourself, by clicking on “Assign to me” option next to it.

But remember it would be basically something like this meme:

merging your own request meme

Then it is a good habit to maintain a clean repo, so maybe you want to select the delete source branch when merge request is accepted. That way you don’t have to actually go and delete your branches manually as was explained in the Git Delete a branch chapter.

Step 4: The final step is to simply click on Finish.

When you do that, your merge request or MR will begin to show in the Merge Requests page as shown in the image below:

How to Create a Merge Request in GitLab final

If you liked our tutorial, tell us in the comments section below. Like us on Facebook and subscribe to us via email, so you don’t miss an update.

Scottshak

Poet. Author. Blogger. Screenwriter. Director. Editor. Software Engineer. Author of "Songs of a Ruin" and proud owner of four websites and two production houses. Also, one of the geekiest Test Automation Engineers based in Ahmedabad.

You may also like...

Leave a Reply