Skip to Content

Merge Requests

A merge request is a way to propose changes you’ve made in a branch to be merged into another branch, usually the main branch. This allows others to review your work before it becomes part of the project.

Creating a Merge Request

Push your changes to a branch

  1. Make sure your changes are saved and committed to a branch.

    Assuming you’re working on a branch called my-feature-branch, you can push your changes to the branch using the following command:

    terminal
    # confirm you have changes git status # add/stage changes git add . git commit -m "My feature changes" git push origin my-feature-branch

Go to your GitLab project

  1. Open your web browser and navigate to your GitLab repository.

Start the merge request

  1. On the left sidebar, click on Merge Requests.
    • You can also find it under Code > Merge Requests if not pinned.
  2. Click on the New merge request button.

Choose source and target branches

  1. On the Source branch side, click Select source branch dropdown and select the branch where your changes are (eg. my-feature-branch).
  2. Beside is the Target branch, click Select target branch dropdown and select the branch you want to merge into (eg> main or develop).

Review and add details

  1. Enter a title and description for your merge request. Be clear about what changes you’ve made and why.
    • This usually comes prefilled from the commit message you created when you pushed your changes.
  2. You can also assign reviewers, add labels, or set a milestone if needed.

Create the merge request

  1. Click the “Create merge request” button.

Wait for review and approval

  1. Your merge request is now created! You can wait for feedback, comments, or approval from your team before the changes are merged.

Here’s a demo showing how to create a merge request. Click here

Last updated on