HatchJS Logo

HatchJS.com

Cracking the Shell of Mystery

GitLab Merge Request Assignee: What It Is and How to Use It

Avatar

GitLab Merge Request Assignees: What They Are and How to Use Them

When you’re working on a team project in GitLab, it’s important to assign merge requests to the right people. This ensures that the right people are responsible for reviewing and merging the changes, and that everyone is on the same page about what needs to be done.

In this article, we’ll discuss what merge requests are, why it’s important to assign them to specific people, and how to do so in GitLab. We’ll also provide some tips for effectively managing merge requests.

What are merge requests?

A merge request is a way to propose changes to a project’s code base. When you create a merge request, you’re essentially telling the other developers on your team that you have some changes that you’d like to be merged into the main branch.

Merge requests are a valuable tool for collaborating on code. They allow developers to work on different parts of a project independently, and then merge their changes together when they’re finished. This helps to keep the code base organized and ensures that everyone is working on the same version of the project.

Why is it important to assign merge requests?

When you create a merge request, you should always assign it to one or more people. This is important for several reasons.

First, it helps to ensure that the right people are reviewing and merging your changes. If you don’t assign a merge request to anyone, it’s possible that it will be overlooked or that the wrong people will review it.

Second, assigning a merge request helps to keep track of who is responsible for what. This can be especially important if you’re working on a large project with multiple developers.

Finally, assigning a merge request can help to speed up the review process. When the reviewers know who is responsible for the changes, they can contact that person directly if they have any questions or concerns.

How to assign merge requests in GitLab

Assigning a merge request in GitLab is easy. Just follow these steps:

1. Open the merge request in GitLab. 2. Click the Assign button. 3. Select the people you want to assign the merge request to. 4. Click the Save button.

The merge request will now be assigned to the people you selected. They will be notified by email that they have been assigned a merge request, and they will be able to see the merge request in their list of pending reviews.

Tips for effectively managing merge requests

Here are a few tips for effectively managing merge requests:

  • Assign merge requests to the right people. Make sure to assign merge requests to people who are familiar with the code base and who are able to review the changes.
  • Keep track of who is responsible for what. When you assign a merge request to someone, make sure to note who is responsible for reviewing the changes and who is responsible for merging the changes into the main branch.
  • Communicate with the reviewers. If you have any questions or concerns about the merge request, be sure to communicate with the reviewers. This will help to ensure that the merge request is reviewed and merged in a timely manner.
  • Be patient. Merge requests can take some time to be reviewed and merged. Be patient and don’t get discouraged if your merge request doesn’t get merged right away.

By following these tips, you can effectively manage merge requests and ensure that your code base is kept up-to-date and organized.

A GitLab merge request assignee is a user who is responsible for reviewing and merging a merge request. The assignee can be any user who has access to the repository. The assignee can be assigned manually or automatically.

What is a GitLab merge request?

A GitLab merge request is a way to propose changes to a project’s code base. When you create a merge request, you are essentially suggesting that your changes be merged into the main branch of the project.

Why do you need a GitLab merge request assignee?

A GitLab merge request assignee is important because they are responsible for reviewing and merging your changes. They will need to make sure that your changes are correct, that they do not introduce any new bugs, and that they are in line with the project’s coding standards.

How to assign a GitLab merge request assignee?

There are two ways to assign a GitLab merge request assignee: manually and automatically.

Manually assigning a GitLab merge request assignee

To manually assign a merge request assignee, click on the “Assignees” tab and select the user from the list.

Automatically assigning a GitLab merge request assignee

You can use a workflow rule to automatically assign a merge request assignee. A workflow rule is a set of conditions that, when met, will trigger a specific action. In this case, the action would be to assign a merge request assignee.

To create a workflow rule, click on the “Settings” icon and select “Workflows”. Then, click on the “Create a new rule” button.

In the “Name” field, enter a name for your workflow rule. In the “Event” field, select “Merge request opened”. In the “Conditions” section, you can specify the conditions that must be met for the rule to be triggered. For example, you could specify that the merge request must be created by a specific user or that it must have a certain number of approvals.

In the “Actions” section, you can specify the actions that will be taken when the rule is triggered. In this case, you would select “Assign assignee” and then select the user who will be assigned to the merge request.

Click on the “Create” button to save your workflow rule.

Assigning a GitLab merge request assignee is important because it ensures that your changes are reviewed and merged correctly. You can assign a merge request assignee manually or automatically. To manually assign a merge request assignee, click on the “Assignees” tab and select the user from the list. To automatically assign a merge request assignee, you can use a workflow rule.

3. What are the benefits of assigning a GitLab merge request assignee?

Assigning a merge request assignee can have a number of benefits, including:

  • Ensuring that the merge request is reviewed and merged in a timely manner. When a merge request is assigned to a specific user, that user is responsible for reviewing the request and merging it into the main branch. This helps to ensure that the merge request is not forgotten about or delayed.
  • Identifying who is responsible for the merge request. When a merge request is assigned to a specific user, it is clear who is responsible for reviewing and merging the request. This can help to avoid confusion and ensure that the merge request is handled in a timely manner.
  • Improving the quality of the merge request. When a merge request is assigned to a specific user, that user is more likely to take the time to review the request carefully and make sure that it is of high quality. This can help to avoid merge conflicts and other problems that can occur when merging code.

In addition to these benefits, assigning a merge request assignee can also help to improve collaboration and communication between team members. When a merge request is assigned to a specific user, that user is more likely to be involved in the discussion about the request and to provide feedback on the changes. This can help to ensure that the merge request is reviewed by multiple people and that all of the relevant concerns are addressed.

Overall, assigning a merge request assignee can be a valuable tool for managing merge requests and ensuring that they are reviewed and merged in a timely and efficient manner.

4. How to remove a GitLab merge request assignee?

To remove a merge request assignee, follow these steps:

1. Navigate to the merge request in GitLab. 2. Click on the “Assignees” tab. 3. Click on the “x” button next to the user’s name.

The user will be removed as an assignee of the merge request.

You can also remove a merge request assignee by clicking on the “More” button and selecting “Remove assignee”.

Assigning and removing merge request assignees is a simple process that can help to improve the management of merge requests. By assigning a merge request assignee, you can ensure that the request is reviewed and merged in a timely manner. By removing a merge request assignee, you can remove the user from the list of people who are responsible for reviewing and merging the request.

Q: What is a GitLab merge request assignee?

A GitLab merge request assignee is a user who is responsible for reviewing and merging a merge request.

Q: How do I assign a merge request to someone?

To assign a merge request to someone, you can do the following:

1. Open the merge request in GitLab. 2. Click the Assign button. 3. Enter the username of the user you want to assign the merge request to. 4. Click the Assign button.

Q: How do I remove a merge request assignee?

To remove a merge request assignee, you can do the following:

1. Open the merge request in GitLab. 2. Click the Assignee dropdown menu. 3. Select Unassign .

Q: What happens when a merge request is assigned to someone?

When a merge request is assigned to someone, the following things happen:

  • The assignee is notified by email that they have been assigned a merge request.
  • The assignee’s name is added to the Assignee list on the merge request page.
  • The assignee can view and comment on the merge request.
  • The assignee can merge the merge request if they have the necessary permissions.

Q: What are the benefits of assigning a merge request to someone?

There are several benefits to assigning a merge request to someone, including:

  • It helps to ensure that the merge request is reviewed and merged in a timely manner.
  • It helps to assign responsibility for the merge request to a specific person.
  • It can help to improve the quality of the merge request by ensuring that it is reviewed by someone who is familiar with the code.

Q: What are the risks of assigning a merge request to someone?

There are some risks associated with assigning a merge request to someone, including:

  • The assignee may not be available to review or merge the merge request in a timely manner.
  • The assignee may not have the necessary skills or knowledge to review or merge the merge request.
  • The assignee may not be familiar with the code and may make changes that break the project.

Q: How can I avoid the risks of assigning a merge request to someone?

There are a few things you can do to avoid the risks of assigning a merge request to someone, including:

  • Choose an assignee who is available and has the necessary skills and knowledge to review or merge the merge request.
  • Provide the assignee with enough information about the merge request so that they can understand it and make informed decisions.
  • Monitor the merge request to ensure that it is being reviewed and merged in a timely manner.

Q: What other questions do you have about GitLab merge request assignees?

Please feel free to ask any other questions you have about GitLab merge request assignees in the comments below.

In this blog post, we have discussed how to assign a merge request in GitLab. We covered the different ways to assign a merge request, as well as the implications of assigning a merge request to someone. We also provided some tips on how to effectively assign merge requests.

We hope that this blog post has been helpful. If you have any questions or comments, please feel free to reach out to us.

Here are some key takeaways from this blog post:

  • To assign a merge request, you can click on the “Assign” button and select the user you want to assign the merge request to.
  • You can also assign a merge request to multiple users by clicking on the “Add assignee” button and entering the usernames of the users you want to assign the merge request to.
  • When you assign a merge request, the assignee will receive an email notification.
  • The assignee is responsible for reviewing the merge request and merging it into the target branch.
  • You can revoke an assignment by clicking on the “Unassign” button.

We encourage you to use the information in this blog post to effectively assign merge requests in GitLab.

Author Profile

Marcus Greenwood

Latest entries

  • December 26, 2023 Error Fixing User: Anonymous is not authorized to perform: execute-api:invoke on resource: How to fix this error
  • December 26, 2023 How To Guides Valid Intents Must Be Provided for the Client: Why It’s Important and How to Do It
  • December 26, 2023 Error Fixing How to Fix the The Root Filesystem Requires a Manual fsck Error
  • December 26, 2023 Troubleshooting How to Fix the `sed unterminated s` Command

Similar Posts

Vscode python was not found: how to run without arguments.

VSCode Python Was Not Found: Run Without Arguments Visual Studio Code (VSCode) is a popular code editor that supports a variety of programming languages, including Python. However, some users have reported encountering an error message when trying to run Python code in VSCode: “Python was not found. Please install Python and ensure that the ‘python’…

How to Find the Maximum Speed in Physics

How to Find Maximum Speed in Physics Have you ever wondered what the fastest speed possible is? Or how to find the maximum speed of an object? In this article, we’ll explore the concept of maximum speed in physics, and we’ll learn how to calculate it for different types of objects. We’ll start by defining…

Cypress: How to wait for a page to load

Cypress wait for page to load Cypress is a powerful end-to-end testing framework that can be used to test web applications. One of the most common tasks when testing a web application is waiting for a page to load. Cypress provides several ways to do this, each with its own advantages and disadvantages. In this…

How to Read from STDIN in Rust

Rust Read from Standard Input The Rust programming language has a rich standard library that provides a variety of tools for working with input and output. One of the most basic and essential tasks is reading data from the standard input, which is typically the keyboard. In this article, we will explore the different ways…

How to Build a Wheel for wxPython

Building Wheels for wxPython wxPython is a popular cross-platform GUI toolkit for Python. It is used to create graphical user interfaces for applications that can run on Windows, macOS, and Linux. Wheels are a distribution format for Python packages that makes it easy to install and deploy software. In this article, we will show you…

How to Stream Multiple RTSP Streams with FFmpeg

FFmpeg Multiple RTSP Streams: How to Stream Multiple Videos Simultaneously In today’s world, it is more important than ever to be able to stream multiple videos simultaneously. Whether you are a YouTuber, a live streamer, or simply want to share your videos with friends and family, FFmpeg can help you do it. FFmpeg is a…

Working with GitLab Merge Requests - Tutorial

Introduction.

GitLab merge requests, also known as pull requests in some version control systems, are a fundamental part of the collaborative development process. They enable developers to propose changes, review code, and merge contributions into the main branch. In this tutorial, we will explore how to work with GitLab merge requests and provide examples to guide you through the process.

Prerequisites

Before we begin, make sure you have the following:

  • A GitLab account
  • A project with a branch where you want to create a merge request

Step-by-Step Guide

Creating a merge request.

To create a merge request in GitLab, follow these steps:

  • Login to your GitLab account and navigate to your project.
  • Switch to the branch you want to merge into the main branch.
  • Click on the "New merge request" button.
  • Review the source and target branches. The source branch is typically your working branch, and the target branch is the branch you want to merge the changes into.
  • Provide a title and description for the merge request, explaining the changes you've made and any other relevant details.
  • Assign the merge request to the appropriate reviewer(s) and add any necessary labels or milestones.
  • Submit the merge request and wait for the reviewer(s) to provide feedback.

Merging a Merge Request

Once a merge request has been reviewed and approved, you can merge it into the main branch using the following steps:

  • Navigate to the merge request that has been approved.
  • Review any discussions and changes requested by the reviewer(s).
  • If all feedback has been addressed, click on the "Merge" button.
  • Choose the merge method (e.g., "Merge immediately," "Rebase and merge," or "Squash and merge").
  • Optionally, delete the source branch after merging.
  • Click on the "Merge" button to merge the changes into the main branch.

Common Mistakes to Avoid

  • Not providing a clear and descriptive title for the merge request, which can make it difficult for reviewers to understand the purpose of the changes.
  • Ignoring reviewer feedback or not engaging in discussions, which can result in unresolved issues or misunderstandings.
  • Merging a merge request without proper testing or verification, potentially introducing bugs or breaking the application.

Frequently Asked Questions (FAQs)

Can i make changes to a merge request after it has been submitted.

Yes, you can make changes to a merge request even after it has been submitted. Simply push new commits to the source branch, and the changes will be reflected in the merge request.

Can I add reviewers to a merge request?

Yes, you can add reviewers to a merge request in GitLab. When creating or editing a merge request, you can specify one or more reviewers who will be notified and asked to review the changes.

GitLab merge requests play a crucial role in collaborative development and code review. In this tutorial, we explored the process of creating and merging merge requests, ensuring that code changes are thoroughly reviewed before being merged into the main branch. By following best practices and avoiding common mistakes, you can effectively utilize GitLab merge requests to streamline your development workflow and maintain code quality.

  • GitLab tutorial
  • Embedded tutorial
  • C++ tutorial
  • CircleCI tutorial
  • Go Lang tutorial
  • Android tutorial
  • Framework7 tutorial
  • EJB tutorial
  • Azure Kubernetes Service tutorial
  • CouchDB tutorial
  • Community forum
  • Keyboard shortcuts ?
  • Submit feedback
  • Contribute to GitLab

Getting started with merge requests (FREE)

A merge request ( MR ) is the basis of GitLab as a code collaboration and version control.

When working in a Git-based platform, you can use branching strategies to collaborate on code.

A repository is composed by its default branch , which contains the major version of the codebase, from which you create minor branches, also called feature branches , to propose changes to the codebase without introducing them directly into the major version of the codebase.

Branching is especially important when collaborating with others, avoiding changes to be pushed directly to the default branch without prior reviews, tests, and approvals.

When you create a new feature branch, change the files, and push it to GitLab, you have the option to create a merge request , which is essentially a request to merge one branch into another.

The branch you added your changes into is called source branch while the branch you request to merge your changes into is called target branch .

The target branch can be the default or any other branch, depending on the branching strategies you choose.

In a merge request, beyond visualizing the differences between the original content and your proposed changes, you can execute a significant number of tasks before concluding your work and merging the merge request.

You can watch our GitLab Flow video for a quick overview of working with merge requests.

How to create a merge request

Learn the various ways to create a merge request .

What you can do with merge requests

When you start a new merge request, you can immediately include the following options. You can also add them later by either selecting Edit on the merge request's page at the top-right side, or by using keyboard shortcuts for merge requests :

  • Assign the merge request to a colleague for review. With multiple assignees , you can assign it to more than one person at a time.
  • Set a milestone to track time-sensitive changes.
  • Add labels to help contextualize and filter your merge requests over time.
  • Require approval from your team. (PREMIUM)
  • Close issues automatically when they are merged.
  • Enable the delete source branch when merge request is accepted option to keep your repository clean.
  • Enable the squash commits when merge request is accepted option to combine all the commits into one before merging, thus keep a clean commit history in your repository.
  • Set the merge request as a Draft to avoid accidental merges before it is ready.

After you have created the merge request, you can also:

  • Discuss your implementation with your team in the merge request thread.
  • Perform inline code reviews .
  • Add merge request dependencies to restrict it to be merged only when other merge requests have been merged. (PREMIUM)
  • Preview continuous integration pipelines on the merge request widget .
  • Preview how your changes look directly on your deployed application with Review Apps .
  • Allow collaboration on merge requests across forks .
  • Perform a Review to create multiple comments on a diff and publish them when you're ready.
  • Add code suggestions to change the content of merge requests directly into merge request threads, and easily apply them to the codebase directly from the UI.
  • Add a time estimation and the time spent with that merge request with Time Tracking .

Many of these options can be set:

  • From the merge request page, with keyboard shortcuts .
  • When pushing changes from the command line, with Git push options .

See also other features associated to merge requests .

Assignee

Choose an assignee to designate someone as the person responsible for the first review of the merge request . Open the drop down box to search for the user you wish to assign, and the merge request is added to their assigned merge request list .

Multiple assignees (PREMIUM)

Moved to GitLab Premium in 13.9

Multiple people often review merge requests at the same time. GitLab allows you to have multiple assignees for merge requests to indicate everyone that is reviewing or accountable for it.

multiple assignees for merge requests sidebar

To assign multiple assignees to a merge request:

  • From a merge request, expand the right sidebar and locate the Assignees section.
  • Click on Edit and from the dropdown menu, select as many users as you want to assign the merge request to.

Similarly, assignees are removed by deselecting them from the same dropdown menu.

It is also possible to manage multiple assignees:

  • When creating a merge request.
  • Using quick actions .

Reviewer

WARNING: Requesting a code review is an important part of contributing code. However, deciding who should review your code and asking for a review are no easy tasks. Using the "assignee" field for both authors and reviewers makes it hard for others to determine who's doing what on a merge request.

The merge request Reviewers feature enables you to request a review of your work, and see the status of the review. Reviewers help distinguish the roles of the users involved in the merge request. In comparison to an Assignee , who is directly responsible for creating or merging a merge request, a Reviewer is a team member who may only be involved in one aspect of the merge request, such as a peer review.

To request a review of a merge request, expand the Reviewers select box in the right-hand sidebar. Search for the users you want to request a review from. When selected, GitLab creates a to-do list item for each reviewer.

To learn more, read Review a merge request .

Merge requests to close issues

To create a merge request to close an issue when it's merged, you can either:

Add a note in the MR description .

In the issue, select Create a merge request . Then, you can either:

  • Create a new branch and a draft merge request in one action. The branch is named issuenumber-title by default, but you can choose any name, and GitLab verifies that it's not already in use. The merge request inherits the milestone and labels of the issue, and is set to automatically close the issue when it is merged.
  • Create a new branch only, with its name starting with the issue number.

If the issue is confidential , you may want to use a different workflow for merge requests for confidential issues to prevent confidential information from being exposed.

Deleting the source branch

When creating a merge request, select the Delete source branch when merge request accepted option, and the source branch is deleted when the merge request is merged. To make this option enabled by default for all new merge requests, enable it in the project's settings .

This option is also visible in an existing merge request next to the merge request button and can be selected or deselected before merging. It is only visible to users with the Maintainer role in the source project.

If the user viewing the merge request does not have the correct permissions to delete the source branch and the source branch is set for deletion, the merge request widget displays the Deletes source branch text.

Delete source branch status

Branch retargeting on merge (FREE SELF)

Introduced in GitLab 13.9. Disabled on self-managed in GitLab 13.9. Enabled on self-managed GitLab 13.10.

In specific circumstances, GitLab can retarget the destination branch of open merge request, if the destination branch merges while the merge request is open. Merge requests are often chained in this manner, with one merge request depending on another:

  • Merge request 1 : merge feature-alpha into main .
  • Merge request 2 : merge feature-beta into feature-alpha .

These merge requests are usually handled in one of these ways:

  • Merge request 1 is merged into main first. Merge request 2 is then retargeted to main .
  • Merge request 2 is merged into feature-alpha . The updated merge request 1, which now contains the contents of feature-alpha and feature-beta , is merged into main .

GitLab retargets up to four merge requests when their target branch is merged into main , so you don't need to perform this operation manually. Merge requests from forks are not retargeted.

The feature today works only on merge. Clicking the Remove source branch button after the merge request was merged will not automatically retarget a merge request. This improvement is tracked as a follow-up .

Recommendations and best practices for merge requests

  • When working locally in your branch, add multiple commits and only push when you're done, so GitLab runs only one pipeline for all the commits pushed at once. By doing so, you save CI/CD minutes.
  • Delete feature branches on merge or after merging them to keep your repository clean.
  • Take one thing at a time and ship the smallest changes possible. By doing so, reviews are faster and your changes are less prone to errors.
  • Do not use capital letters nor special chars in branch names.

Creating merge requests

DETAILS: Tier: Free, Premium, Ultimate Offering: SaaS, self-managed

GitLab provides many different ways to create a merge request.

NOTE: GitLab enforces branch naming rules to prevent problems, and provides branch naming patterns to streamline merge request creation.

From the merge request list

You can create a merge request from the list of merge requests.

On the left sidebar, select Search or go to and find your project.

Select Code > Merge requests .

  • In the upper-right corner, select New merge request .
  • Select a source and target branch, then select Compare branches and continue .
  • Complete the fields on the New merge request page, then select Create merge request .

Each branch can be associated with only one open merge request. If a merge request already exists for this branch, a link to the existing merge request is shown.

From an issue

Changed the behavior of the Create merge request button to open the merge request creation form in GitLab 14.8.

If your development workflow requires an issue for every merge request, you can create a branch directly from the issue to speed the process up. The new branch, and later its merge request, are marked as related to this issue. After merging the merge request, the issue is closed automatically, unless automatic issue closing is disabled :

:::TabTitle Merge request and branch

To create a branch and a merge request at the same time:

  • Select Plan > Issues and find your issue.
  • Go to the bottom of the issue description.
  • Select Create merge request > Create merge request and branch .
  • In the dialog, review the suggested branch name. It's based on your project's branch name template Rename it if the branch name is already taken, or you need a different branch name.
  • Select a source branch or tag.
  • Select Create merge request .

:::TabTitle Branch only

To create only a branch directly from an issue:

  • Select Create merge request > Create branch .
  • Select Create branch .

If your Git repository is empty, GitLab:

  • Creates a default branch.
  • Commits a blank README.md file to it.
  • Creates and redirects you to a new branch based on the issue title.
  • If your project is configured with a deployment service like Kubernetes, GitLab prompts you to set up auto deploy by helping you create a .gitlab-ci.yml file.

If the name of the branch you create is prefixed with the issue number , GitLab cross-links the issue and merge request, and adds the issue closing pattern to the description of the merge request. In most cases, this looks like Closes #ID , where ID is the ID of the issue. If your project is configured with a closing pattern , the issue closes when the merge request merges.

When you add, edit, or upload a file

You can create a merge request when you add, edit, or upload a file to a repository.

  • Add, edit, or upload a file to the repository.
  • In the Commit message , enter a reason for the commit.
  • Select the Target branch or create a new branch by typing the name.
  • Select the Start a new merge request with these changes checkbox or toggle. This checkbox or toggle is visible only if the target is not the same as the source branch, or if the source branch is protected.
  • Select Upload file .
  • Fill out the fields and select Create merge request .

When you create a branch

You can create a merge request when you create a branch.

  • Select Code > Branches .
  • Type a branch name and select New branch .
  • Above the file list, on the right side, select Create merge request . A merge request is created. The default branch is the target.

When you use Git commands locally

You can create a merge request by running Git commands on your local machine.

Create a branch:

Create, edit, or delete files as needed.

Mark the files as ready to commit (staging them) and commit them locally:

Push your branch and its commits to GitLab :

To reduce the number of fields to edit later in the merge request, use push options to set the value of fields.

In the response to the git push , GitLab provides a direct link to create the merge request:

Copy the link and paste it in your browser.

When you work in a fork

You can create a merge request from your fork to contribute back to the main project.

On the left sidebar, select Search or go to and find your fork.

Select Code > Merge requests , and select New merge request .

For Source branch , select the branch in your fork that contains your changes.

For Target branch :

  • Select the target project. (Make sure to select the upstream project, rather than your fork.)
  • Select a branch from the upstream repository.

NOTE: If you contribute changes upstream frequently, consider setting a default target project for your fork.

Select Compare branches and continue .

Select Create merge request . The merge request is created in the target project, not your fork.

After your work merges, unlink your fork from its upstream project if you don't intend to make more contributions.

For more information, see the forking workflow documentation .

Set the default target project

By default, merge requests originating from a fork target the upstream project, not the forked project.

You can configure your forked project to be the default target rather than the upstream project.

Prerequisites:

  • You're working in a fork.
  • You must have at least the Developer role, or be allowed to create merge requests in the project.
  • The upstream project allows merge requests to be created.
  • The visibility settings for the fork must match, or be less strict than, the upstream repository. For example: this setting isn't shown if your fork is private, but the upstream is public.

To do this:

  • Select Settings > Merge requests .
  • In the Target project section, select the option you want to use for your default target project.
  • Select Save changes .

By sending an email

You can create a merge request by sending an email message to GitLab. The merge request target branch is the project's default branch.

  • The merge request must target the current project, not an upstream project.
  • A GitLab administrator must configure incoming email .
  • A GitLab administrator must configure Reply by email .

To create a merge request by sending an email:

If the project contains any merge requests, select Email a new merge request to this project .

In the dialog, copy the email address shown. Keep this address private. Anyone who has it can create issues or merge requests as if they were you.

Open an email and compose a message with the following information:

  • The To line is the email address you copied.
  • The Subject is the source branch name.
  • The body of the email is the merge request description.

To add commits, attach .patch files to the message.

Send the email.

A merge request is created.

Add attachments when creating a merge request by email

Add commits to a merge request by adding patches as attachments to the email.

  • The combined size of the patches must be 2 MB or less.
  • To be considered a patch, the attachment's filename must end in .patch .
  • Patches are processed in order by name.
  • If the source branch from the subject does not exist, it is created from the repository's HEAD , or the default target branch. To change the target branch manually, use the /target_branch quick action .
  • If the source branch already exists, patches are applied on top of it.

Troubleshooting

no option to create a merge request on an issue.

The option to Create merge request doesn't display on an issue if:

  • A branch with the same name already exists.
  • A merge request already exists for this branch.
  • Your project has an active fork relationship.
  • Your project is private and the issue is confidential.

To make this button appear, one possible workaround is to remove your project's fork relationship . After removal, the fork relationship cannot be restored. This project can no longer be able to receive or send merge requests to the source project, or other forks.

Email message could not be processed

When sending an email to create a merge request, and you attempt to target an upstream project, GitLab responds with this error:

How-To Geek

How to conduct code reviews with gitlab's merge requests.

GitLab's Merge Requests are your chance to review code before it enters your project's main branch.

Quick Links

Creating a merge request, creating merge requests from your terminal, reviewing merge requests, making changes to your code, draft (work-in-progress) merge requests, completing your review.

GitLab's Merge Requests are your chance to review code before it enters your project's main branch. A Merge Request (MR) is a wrapper around a

operation that's accessible within the GitLab web UI. Once you've reviewed your code, you can initiate the merge with a single click. Adopting an MR-driven workflow helps you guarantee code quality by creating an expectation that all commits are thoroughly reviewed.

Merge Requests are one of the foundational elements of the GitLab experience. They combine its project management, repository and CI/CD systems into a single page for each change in your codebase. We're using the open-source GitLab CE in this article. Commercial tiers have access to additional features.

You can create a new MR from within GitLab by navigating to Repository > Branches in the sidebar. Make sure you've pushed the changes on your local branch up to GitLab. Find the branch you'd like to merge and click the "Merge request" button to the right of its name.

Use the form to define the properties of your merge request. Start by titling your new MR. Next, add a description. Standards for descriptions vary by organisation and by project. In general, you'll want to note down any important changes you've made, as well as the reasoning behind them.

At the bottom of the page, you'll find controls for setting the MR's assignee, reviewer, milestone and labels. These can be amended at any time using the right sidebar on the merge request details page. We'll cover them in more detail later on.

You can complete an initial review without submitting your MR. Use the "Commits" and "Changes" tabs to confirm you've included the correct code. Once you're ready, hit the green "Submit merge request" button to open the MR. You can view all the MRs in your project using the "Merge Requests" link in the sidebar.

Creating MRs through the GitLab UI encourages you to accurately tag the MR with labels, milestones and descriptive text. Nonetheless, it's a laborious process which can consume substantial time through the day. GitLab supports Git push options that allow you to push a branch and create an MR at the same time.

git push -u origin HEAD -o merge_request.create -o merge_request.target=master

Using git push with the options shown above will push your current branch to your Git remote. The remote branch will be created anew, using the same name as your local branch, if it doesn't already exist. The two -o options will be processed by GitLab. They'll result in a new MR being opened to merge your branch into master .

GitLab will automatically populate the MR's title and description using information from your latest commit. In addition, you can reference a GitLab issue in your commit message - e.g.  Fixes #123 - to have GitLab automatically apply its labels and milestones to the MR.

No code is complete until it's been reviewed. You can easily request others in your group to give your commits the once-over. Use the right sidebar to select one or more reviewers. They'll be notified of your request.

You may also assign your MR to another user. This might indicate that they need to update their areas of responsibility to add compatibility with your changes. There's no hard-and-fast rules on how you should use these features.

When you're tasked with reviewing an MR, switch to the "Commits" and "Changes" tabs at the top of the screen. The former gives a list of all the new commits on your branch while the latter presents the file diffs to apply to the codebase.

You can adjust the layout of the Changes screen using the settings cog in the top-right. You can choose between Inline and Side-by-Side diffs, the latter displaying the "old" and "new" versions of files in a split view. You can help yourself focus, and improve the screen's performance, by enabling the "Show one file at a time" option.

Despite all your best efforts, sometimes you'll review your MR and discover an issue you hadn't spotted before. You don't need to head straight back to your code editor though. The Changes screen has provisions available to help you correct errors as you find them.

For simple one-line fixes, hover over the line in question. Click the comment icon that appears to the left of the line. The comment editor will appear, featuring GitLab's standard Markdown editor. You can use this facility to comment on specific lines in your MR - your messages will appear back on the "Overview" tab. We're looking for a specific feature though, the "Insert suggestion" button on the toolbar.

Click the button to insert the selected line into your comment. Use the comment editor to edit the line to what it should look like. Next, click either "Start a review" or "Add comment now". The former lets you hold multiple comments together to submit as a batch once you've completed your review.

Once you've saved your comment, you'll see a "Suggested change" widget appear below the suspect line. This will display the new diff to apply. Click the "Apply suggestion" button to instantly add your change.

Using Suggestions can dramatically reduce the time to fix minor issues as you don't need to leave your browser. For longer edits, you may click the three dots icon next to any file on the Changes screen to open it in the full GitLab Web IDE.

Sometimes you'll want to push code before it's ready to merge. You can distinguish these MRs by prefixing their title with "Draft" or clicking the toolbar button. Draft MRs cannot be merged until you manually revoke their draft status by clicking "Mark as ready" in the top-right.

This functionality used to be called "Work-in-Progress," using the "WIP" title prefix. That terminology has now been abandoned in favour of "Draft," which will be the only supported variant in GitLab 14. Both forms are available in GitLab 13.

As you add commits to your MRs, they'll be listed on the Overview section of the MR page. You can click the "Compare with previous version" link to see the diff of these changes in isolation.

Clicking the "Changes" tab without choosing a version displays the diff of the entire MR relative to the target branch. You can view the diff of any two versions using the "Compare [master] and [latest version]" dropdowns at the top of the Changes screen.

Once you've completed your review, it's time to merge your code. You'll need to revoke the MR's Draft status if it's been set. Depending on your project's settings, you might also have to "resolve" any comment threads which have been created.

To signal the MR is ready to be merged, use the blue "Approve" button. This doesn't take any action within GitLab except signalling to your team that the MR has been accepted. You can then go ahead and merge the MR by pressing the green "Merge" button.

Use the "Delete source branch" checkbox to control whether the branch gets deleted after the merge. This helps keep your branches list lean but could lead to loss of context in the future. The "Squash commits" option lets you combine all the commits in the MR into one. This creates a tidier commit history but will make it harder to revert individual changes in the future. The availability of these options will depend on settings defined within your project and your group.

Merge Requests provide a good structure for writing and reviewing code. At the same time, they're extremely flexible and open to interpretation. It's up to you how far you develop your merge request workflow.

In this article, we've only looked at the features directly relevant to a code reviewer. You might see much more information in your merge requests if you make use of GitLab's other features. The Overview page can exhibit CI pipeline status, test and code quality reports, security scan outputs and staging environment links, all of which make the MR page your first destination when understanding how a change will impact your project.

assign merge request gitlab

  • Community forum
  • Keyboard shortcuts ?
  • Submit feedback
  • Contribute to GitLab

Merge requests (FREE ALL)

To incorporate changes from a source branch to a target branch, you use a merge request (MR).

When you open a merge request, you can visualize and collaborate on the changes before merge. Merge requests include:

  • A description of the request.
  • Code changes and inline code reviews.
  • Information about CI/CD pipelines.
  • A comment section for discussion threads.
  • The list of commits.

Create a merge request

Learn the various ways to create a merge request .

Use merge request templates

When you create a merge request, GitLab checks for the existence of a description template to add data to your merge request. GitLab checks these locations in order from 1 to 5, and applies the first template found to your merge request:

NOTE: Items marked with an asterisk (*) also append an issue closing pattern .

View merge requests

You can view merge requests for your project, group, or yourself.

For a project

To view all merge requests for a project:

  • On the left sidebar, at the top, select Search GitLab ( {search} ) to find your project.

Select Code > Merge requests .

Or, to use a keyboard shortcut , press g + m .

For all projects in a group

To view merge requests for all projects in a group:

  • On the left sidebar, at the top, select Search GitLab ( {search} ) to find your group.

If your group contains subgroups, this view also displays merge requests from the subgroup projects.

Assigned to you

To view all merge requests assigned to you:

  • On the left sidebar, at the top, select Search GitLab ( {search} ).
  • From the dropdown list, select Merge requests assigned to me .
  • To use a keyboard shortcut , press Shift + m .
  • On the left sidebar, select Code > Merge requests ( {merge-request} ).
  • From the dropdown list, select Assigned .

Filter the list of merge requests

Filtering by approved-by introduced in GitLab 13.0. Filtering by reviewer introduced in GitLab 13.7. Filtering by potential approvers was moved to GitLab Premium in 13.9. Filtering by approved-by moved to GitLab Premium in 13.9.

To filter the list of merge requests:

  • Above the list of merge requests, select Search or filter results... .
  • By environment or deployment date .
  • ID : Enter filter #30 to return only merge request 30.
  • Approved-By , for merge requests already approved by a user. (PREMIUM) .
  • Approver , for merge requests that this user is eligible to approve. (For more information, read about Code owners ). (PREMIUM)
  • Reviewer , for merge requests reviewed by this user.
  • = : Is
  • != : Is not
  • Enter the text to filter the attribute by. You can filter some attributes by None or Any .
  • Repeat this process to filter by multiple attributes. Multiple attributes are joined by a logical AND .
  • Select a Sort direction , either {sort-lowest} for descending order, or {sort-highest} for ascending order.

By environment or deployment date

Introduced in GitLab 13.6.

To filter merge requests by deployment data, such as the environment or a date, you can type (or select from the dropdown list) the following:

  • Environment
  • Deployed-before
  • Deployed-after

NOTE: Projects using a fast-forward merge method do not return results, as this method does not create a merge commit.

When filtering by an environment, a dropdown list presents all environments that you can choose from.

When filtering by Deployed-before or Deployed-after :

  • The date refers to when the deployment to an environment (triggered by the merge commit) completed successfully.
  • You must enter the deploy date manually.
  • Deploy dates use the format YYYY-MM-DD , and must be wrapped in double quotes ( " ) if you want to specify both a date and time ( "YYYY-MM-DD HH:MM" ).

Add changes to a merge request

If you have permission to add changes to a merge request, you can add your changes to an existing merge request in several ways, depending on the complexity of your change and whether you need access to a development environment:

  • Edit changes in the Web IDE in your browser with the . keyboard shortcut . Use this browser-based method to edit multiple files, or if you are not comfortable with Git commands. You cannot run tests from the Web IDE.
  • Edit changes in Gitpod , if you need a fully-featured environment to both edit files, and run tests afterward. Gitpod supports running the GitLab Development Kit (GDK) . To use Gitpod, you must enable Gitpod in your user account .
  • Push changes from the command line , if you are familiar with Git and the command line.

Assign a user to a merge request

To assign the merge request to a user, use the /assign @user quick action in a text area in a merge request, or:

  • Select Code > Merge requests and find your merge request.
  • On the right sidebar, expand the right sidebar and locate the Assignees section.
  • Select Edit .
  • Search for the user you want to assign, and select the user.

The merge request is added to the user's assigned merge request list.

Assign multiple users (PREMIUM ALL)

Moved to GitLab Premium in 13.9.

GitLab enables multiple assignees for merge requests, if multiple people are accountable for it:

multiple assignees for merge requests sidebar

To assign multiple assignees to a merge request, use the /assign @user quick action in a text area, or:

  • Select Edit and, from the dropdown list, select all users you want to assign the merge request to.

To remove an assignee, clear the user from the same dropdown list.

Close a merge request

If you decide to permanently stop work on a merge request, GitLab recommends you close the merge request rather than delete it . The author and assignees of a merge request, and users with Developer, Maintainer, or Owner roles in a project can close merge requests in the project:

  • Go to the merge request you want to close.
  • Scroll to the comment box at the bottom of the page.
  • Following the comment box, select Close merge request .

GitLab closes the merge request, but preserves records of the merge request, its comments, and any associated pipelines.

Delete a merge request

GitLab recommends you close, rather than delete, merge requests.

WARNING: You cannot undo the deletion of a merge request.

To delete a merge request:

  • Sign in to GitLab as a user with the project Owner role. Only users with this role can delete merge requests in a project.
  • Go to the merge request you want to delete, and select Edit .
  • Scroll to the bottom of the page, and select Delete merge request .

Delete the source branch on merge

You can delete the source branch for a merge request:

  • When you create a merge request, by selecting Delete source branch when merge request accepted .
  • When you merge a merge request, if you have the Maintainer role, by selecting Delete source branch .

An administrator can make this option the default in the project's settings.

Update merge requests when target branch merges (FREE SELF)

Introduced in GitLab 13.9. Disabled on self-managed in GitLab 13.9. Enabled on self-managed GitLab 13.10.

Merge requests are often chained together, with one merge request depending on the code added or changed in another merge request. To support keeping individual merge requests small, GitLab can update up to four open merge requests when their target branch merges into main . For example:

  • Merge request 1 : merge feature-alpha into main .
  • Merge request 2 : merge feature-beta into feature-alpha .

If these merge requests are open at the same time, and merge request 1 ( feature-alpha ) merges into main , GitLab updates the destination of merge request 2 from feature-alpha to main .

Merge requests with interconnected content updates are usually handled in one of these ways:

  • Merge request 1 is merged into main first. Merge request 2 is then retargeted to main .
  • Merge request 2 is merged into feature-alpha . The updated merge request 1, which now contains the contents of feature-alpha and feature-beta , is merged into main .

This feature works only when a merge request is merged. Selecting Remove source branch after merging does not retarget open merge requests. This improvement is proposed as a follow-up .

Move sidebar actions

Introduced in GitLab 14.10 with a flag named moved_mr_sidebar . Enabled by default. Changed to also move actions on issues, incidents, and epics in GitLab 16.0.

When this feature flag is enabled, in the upper-right corner, Merge request actions ( {ellipsis_v} ) contains the following actions:

  • The notifications toggle
  • Mark merge request as ready or draft
  • Close merge request
  • Lock discussion
  • Copy reference

In GitLab 16.0 and later, similar action menus are available on issues, incidents, and epics.

When this feature flag is disabled, these actions are in the right sidebar.

Merge request workflows

For a software developer working in a team:

  • You check out a new branch, and submit your changes through a merge request.
  • You gather feedback from your team.
  • You work on the implementation optimizing code with Code Quality reports .
  • You verify your changes with Unit test reports in GitLab CI/CD.
  • You avoid using dependencies whose license is not compatible with your project with License approval policies .
  • You request the approval from your manager.
  • Pushes a commit with their final review.
  • Approves the merge request .
  • Sets it to auto-merge (formerly Merge when pipeline succeeds ).
  • Your changes get deployed to production with manual jobs for GitLab CI/CD.
  • Your implementations were successfully shipped to your customer.

For a web developer writing a webpage for your company's website:

  • You check out a new branch and submit a new page through a merge request.
  • You gather feedback from your reviewers.
  • You preview your changes with Review Apps .
  • You request your web designers for their implementation.
  • Once approved, your merge request is squashed and merged , and deployed to staging with GitLab Pages .
  • Your production team cherry-picks the merge commit into production.

Filter activity in a merge request

Introduced in GitLab 15.11 with a flag named mr_activity_filters . Disabled by default. Enabled on GitLab.com in GitLab 16.0. Available to GitLab team members only.

FLAG: On self-managed GitLab, by default this feature is not available. To make it available per user, an administrator can enable the feature flag named mr_activity_filters for individual or groups of users. On GitLab.com, this feature is enabled for GitLab team members only.

To understand the history of a merge request, filter its activity feed to show you only the items that are relevant to you.

Select a merge request.

Scroll to Activity .

On the right side of the page, select Activity filter to show the filter options. If you've selected filter options previously, this field shows a summary of your choices, like Activity + 5 more .

Select the types of activity you want to see. Options include:

  • Assignees & Reviewers
  • Commits & branches
  • Lock status
  • Merge request status

Optional. Select Sort ( {sort-lowest} ) to reverse the sort order.

Your selection persists across all merge requests. You can also change the sort order by clicking the sort button on the right.

Resolve a thread

Resolving comments individually was removed in GitLab 13.6.

In a merge request, you can resolve a thread when you want to finish a conversation.

Prerequisites:

  • You must have at least the Developer role or be the author of the change being reviewed.
  • Resolvable threads can be added only to merge requests. It doesn't work for comments in issues, commits, or snippets.

To resolve a thread:

  • Go to the thread.
  • In the upper-right corner of the original comment, select Resolve thread ( {check-circle} ).
  • Below the last reply, in the Reply field, select Resolve thread .
  • Below the last reply, in the Reply field, enter text, select the Resolve thread checkbox, and select Add comment now .

At the top of the page, the number of unresolved threads is updated:

Count of unresolved threads

Move all unresolved threads in a merge request to an issue

If you have multiple unresolved threads in a merge request, you can create an issue to resolve them separately. In the merge request, at the top of the page, select the ellipsis icon button ( {ellipsis_v} ) in the threads control and then select Resolve all with new issue :

Open new issue for all unresolved threads

All threads are marked as resolved, and a link is added from the merge request to the newly created issue.

Move one unresolved thread in a merge request to an issue

If you have one specific unresolved thread in a merge request, you can create an issue to resolve it separately. In the merge request, under the last reply to the thread, next to Resolve thread , select Create issue to resolve thread ( {issue-new} ):

Create issue for thread

The thread is marked as resolved, and a link is added from the merge request to the newly created issue.

Prevent merge unless all threads are resolved

You can prevent merge requests from being merged until all threads are resolved. When this setting is enabled, the Unresolved threads counter in a merge request is shown in orange when at least one thread remains unresolved.

  • Select Settings > Merge requests .
  • In the Merge checks section, select the All threads must be resolved checkbox.
  • Select Save changes .

Automatically resolve threads in a merge request when they become outdated

You can set merge requests to automatically resolve threads when lines are modified with a new push.

  • In the Merge options section, select Automatically resolve merge request diff threads when they become outdated .

Threads are now resolved if a push makes a diff section outdated. Threads on lines that don't change and top-level resolvable threads are not resolved.

Related topics

  • Create a merge request
  • Review a merge request
  • Authorization for merge requests
  • Testing and reports
  • GitLab keyboard shortcuts
  • Comments and threads
  • Suggest code changes
  • CI/CD pipelines
  • Push options for merge requests

Troubleshooting

rebase a merge request from the rails console (free self) .

In addition to the /rebase quick action , users with access to the Rails console can rebase a merge request from the Rails console. Replace <username> , <namespace/project> , and <iid> with appropriate values:

WARNING: Any command that changes data directly could be damaging if not run correctly, or under the right conditions. We highly recommend running them in a test environment with a backup of the instance ready to be restored, just in case.

Fix incorrect merge request status (FREE SELF)

If a merge request remains Open after its changes are merged, users with access to the Rails console can correct the merge request's status. Replace <username> , <namespace/project> , and <iid> with appropriate values:

Running this command against a merge request with unmerged changes causes the merge request to display an incorrect message: merged into <branch-name> .

Close a merge request from the Rails console (FREE SELF)

If closing a merge request doesn't work through the UI or API, you may want to attempt to close it in a Rails console session :

WARNING: Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.

Delete a merge request from the Rails console (FREE SELF)

If deleting a merge request doesn't work through the UI or API, you may want to attempt to delete it in a Rails console session :

Generated by PLCFactory on 2024-04-11 13:38:28

  • Review changes
  • Check out branch
  • Pipelines 0

Date:

2024-04-11 13:38:28

PLCFactory URL:

https://gitlab.esss.lu.se/icshwi/plcfactory.git

PLCFactory branch:

plcfactory commit:.

78cb0f07287b9257e45d6b0d50a7b7d539a97c12

Command line:

plcfactory.py -d Tgt-THCS:Ctrl- PLC-001 --plc-interface=17 --ioc --enable-python3

Merge request reports

Draft: Refactor ci: aligning deployment methods to a single one

  • Review changes
  • Check out branch
  • Pipelines 0

Merge request reports

CMakePackageConfigHelpers: Restore undocumented PACKAGE_PREFIX_DIR variable

  • Review changes
  • Check out branch
  • Pipelines 2

Revert !9390 (merged) . It regressed existing projects that rely on the undocumented PACKAGE_PREFIX_DIR variable in package configuration files generated by CMakePackageConfigHelpers .

Fixes: #25873 (closed) Fixes: #25885 (closed) Issue: #25827 Backport: release

Merge request reports

Placeholder for global navigation .

Merge requests

DETAILS: Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

A merge request (MR) is a proposal to incorporate changes from a source branch to a target branch.

When you open a merge request, you can visualize and collaborate on the changes before merge. Merge requests include:

  • A description of the request.
  • Code changes and inline code reviews.
  • Information about CI/CD pipelines.
  • A comment section for discussion threads.
  • The list of commits.
  • Create a merge request

Learn the various ways to create a merge request .

Use merge request templates

When you create a merge request, GitLab checks for the existence of a description template to add data to your merge request. GitLab checks these locations in order from 1 to 5, and applies the first template found to your merge request:

View merge requests

You can view merge requests for your project, group, or yourself.

For a project

To view all merge requests for a project:

  • On the left sidebar, select Search or go to and find your project.

Select Code > Merge requests .

Or, to use a keyboard shortcut , press g + m .

For all projects in a group

To view merge requests for all projects in a group:

  • On the left sidebar, select Search or go to and find your group.

If your group contains subgroups, this view also displays merge requests from the subgroup projects.

Assigned to you

To view all merge requests assigned to you:

  • On the left sidebar, select Search or go to .
  • From the dropdown list, select Merge requests assigned to me .
  • To use a keyboard shortcut , press Shift + m .
  • On the left sidebar, select Code > Merge requests ( merge-request ).
  • From the dropdown list, select Assigned .

Filter the list of merge requests

Filtering by source-branch introduced in GitLab 16.6. Filtering by merged-by introduced in GitLab 16.9. Available only when the feature flag mr_merge_user_filter is enabled.

To filter the list of merge requests:

  • Above the list of merge requests, select Search or filter results .
  • By environment or deployment date .
  • ID : Enter filter #30 to return only merge request 30.
  • Approved-By , for merge requests already approved by a user. Premium and Ultimate only.
  • Approver , for merge requests that this user is eligible to approve. (For more information, read about Code owners ). Premium and Ultimate only.
  • Merged-By , for merge requests merged by this user.
  • Reviewer , for merge requests reviewed by this user.
  • != : Is not
  • Enter the text to filter the attribute by. You can filter some attributes by None or Any .
  • Repeat this process to filter by multiple attributes. Multiple attributes are joined by a logical AND .
  • Select a Sort direction , either sort-lowest for descending order, or sort-highest for ascending order.

By environment or deployment date

To filter merge requests by deployment data, such as the environment or a date, you can type (or select from the dropdown list) the following:

  • Environment
  • Deployed-before
  • Deployed-after

When filtering by an environment, a dropdown list presents all environments that you can choose from.

When filtering by Deployed-before or Deployed-after :

  • The date refers to when the deployment to an environment (triggered by the merge commit) completed successfully.
  • You must enter the deploy date manually.
  • Deploy dates use the format YYYY-MM-DD , and must be wrapped in double quotes ( " ) if you want to specify both a date and time ( "YYYY-MM-DD HH:MM" ).

Add changes to a merge request

If you have permission to add changes to a merge request, you can add your changes to an existing merge request in several ways, depending on the complexity of your change and whether you need access to a development environment:

  • Edit changes in the Web IDE in your browser with the . keyboard shortcut . Use this browser-based method to edit multiple files, or if you are not comfortable with Git commands. You cannot run tests from the Web IDE.
  • Edit changes in Gitpod , if you need a fully-featured environment to both edit files, and run tests afterward. Gitpod supports running the GitLab Development Kit (GDK) . To use Gitpod, you must enable Gitpod in your user account .
  • Push changes from the command line , if you are familiar with Git and the command line.

Assign a user to a merge request

To assign the merge request to a user, use the /assign @user quick action in a text area in a merge request, or:

  • Select Code > Merge requests and find your merge request.
  • On the right sidebar, expand the right sidebar and locate the Assignees section.
  • Select Edit .
  • Search for the user you want to assign, and select the user.

The merge request is added to the user’s assigned merge request list.

Assign multiple users

DETAILS: Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

Moved to GitLab Premium in 13.9.

GitLab enables multiple assignees for merge requests, if multiple people are accountable for it:

To assign multiple assignees to a merge request, use the /assign @user quick action in a text area, or:

  • Select Edit and, from the dropdown list, select all users you want to assign the merge request to.

To remove an assignee, clear the user from the same dropdown list.

Close a merge request

If you decide to permanently stop work on a merge request, GitLab recommends you close the merge request rather than delete it .

Prerequisites:

  • You must be the author or assignees of the merge request, or
  • You must have the Developer, Maintainer, or Owner roles in a project.

To close merge requests in the project:

  • Scroll to the comment box at the bottom of the page.
  • Following the comment box, select Close merge request .

GitLab closes the merge request, but preserves records of the merge request, its comments, and any associated pipelines.

Delete the source branch on merge

You can delete the source branch for a merge request:

  • When you create a merge request, by selecting Delete source branch when merge request accepted .
  • When you merge a merge request, if you have the Maintainer role, by selecting Delete source branch .

An administrator can make this option the default in the project’s settings.

Update merge requests when target branch merges

DETAILS: Tier: Free, Premium, Ultimate Offering: Self-managed

Chained merge requests changed to automatically rebase on the new target branch in GitLab 16.9. Chained merge requests no longer automatically rebase on the new target branch in GitLab 16.10 with a flag named :rebase_when_retargetting_mrs . Disabled by default.

Merge requests are often chained together, with one merge request depending on the code added or changed in another merge request. To support keeping individual merge requests small, GitLab can update up to four open merge requests when their target branch merges into main . For example:

  • Merge request 1 : merge feature-alpha into main .
  • Merge request 2 : merge feature-beta into feature-alpha .

If these merge requests are open at the same time, and merge request 1 ( feature-alpha ) merges into main , GitLab updates the destination of merge request 2 from feature-alpha to main .

Merge requests with interconnected content updates are usually handled in one of these ways:

  • Merge request 1 is merged into main first. Merge request 2 is then retargeted to main .
  • Merge request 2 is merged into feature-alpha . The updated merge request 1, which now contains the contents of feature-alpha and feature-beta , is merged into main .

This feature works only when a merge request is merged. Selecting Remove source branch after merging does not retarget open merge requests. This improvement is proposed as a follow-up .

Move sidebar actions

Introduced in GitLab 14.10 with a flag named moved_mr_sidebar . Enabled by default. Changed to also move actions on issues, incidents, and epics in GitLab 16.0.

When this feature flag is enabled, in the upper-right corner, Merge request actions ( ellipsis_v ) contains the following actions:

  • The notifications toggle
  • Mark merge request as ready or draft
  • Close merge request
  • Lock discussion
  • Copy reference

In GitLab 16.0 and later, similar action menus are available on issues, incidents, and epics.

When this feature flag is disabled, these actions are in the right sidebar.

Merge request workflows

For a software developer working in a team:

  • You check out a new branch, and submit your changes through a merge request.
  • You gather feedback from your team.
  • You work on the implementation optimizing code with Code Quality reports .
  • You verify your changes with Unit test reports in GitLab CI/CD.
  • You avoid using dependencies whose license is not compatible with your project with License approval policies .
  • You request the approval from your manager.
  • Pushes a commit with their final review.
  • Approves the merge request .
  • Sets it to auto-merge (formerly Merge when pipeline succeeds ).
  • Your changes get deployed to production with manual jobs for GitLab CI/CD.
  • Your implementations were successfully shipped to your customer.

For a web developer writing a webpage for your company’s website:

  • You check out a new branch and submit a new page through a merge request.
  • You gather feedback from your reviewers.
  • You preview your changes with Review Apps .
  • You request your web designers for their implementation.
  • Once approved, your merge request is squashed and merged , and deployed to staging with GitLab Pages .
  • Your production team cherry-picks the merge commit into production.

Filter activity in a merge request

Introduced in GitLab 15.11 with a flag named mr_activity_filters . Disabled by default. Enabled on GitLab.com in GitLab 16.0. Enabled on self-managed in GitLab 16.3 by default. Generally available in GitLab 16.5. Feature flag mr_activity_filters removed. Filtering bot comments introduced in GitLab 16.9.

To understand the history of a merge request, filter its activity feed to show you only the items that are relevant to you.

Select a merge request.

Scroll to Activity .

On the right side of the page, select Activity filter to show the filter options. If you’ve selected filter options previously, this field shows a summary of your choices, like Activity + 5 more .

Select the types of activity you want to see. Options include:

  • Assignees & Reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Lock status
  • Merge request status

Optional. Select Sort ( sort-lowest ) to reverse the sort order.

Your selection persists across all merge requests. You can also change the sort order by clicking the sort button on the right.

Resolve a thread

When you want to finish a conversation in a merge request, resolve a thread .

The number of unresolved threads is shown in the top right corner of a merge request, like this: 7 unresolved threads .

Move all unresolved threads in a merge request to an issue

If you have multiple unresolved threads in a merge request, you can create an issue to resolve them separately:

  • In the merge request, in the top right, find the Unresolved threads dropdown list, and select Thread options ( ellipsis_v ).
  • Select Resolve all with new issue .
  • Fill out the fields in the new issue, and select Create issue .

All threads are marked as resolved, and a link is added from the merge request to the newly created issue.

Move one unresolved thread in a merge request to an issue

If you have one specific unresolved thread in a merge request, you can create an issue to resolve it separately:

  • In the merge request, find the thread you want to move.
  • Below the last reply to the thread, next to Resolve thread , select Create issue to resolve thread ( issue-new ).

The thread is marked as resolved, and a link is added from the merge request to the newly created issue.

Prevent merge unless all threads are resolved

You can prevent merge requests from being merged until all threads are resolved. When this setting is enabled, the Unresolved threads counter in a merge request is shown in orange when at least one thread remains unresolved.

  • Select Settings > Merge requests .
  • In the Merge checks section, select the All threads must be resolved checkbox.
  • Select Save changes .

Automatically resolve threads in a merge request when they become outdated

You can set merge requests to automatically resolve threads when lines are modified with a new push.

  • In the Merge options section, select Automatically resolve merge request diff threads when they become outdated .

Threads are now resolved if a push makes a diff section outdated. Threads on lines that don’t change and top-level resolvable threads are not resolved.

Move notifications and to-dos

DETAILs: Tier: Free, Premium, Ultimate Offering: Self-managed

Introduced in GitLab 16.5 with a flag named notifications_todos_buttons . Disabled by default. Issues, incidents , and epics also updated.

When this feature flag is enabled, the notifications and to-do item buttons are moved to the upper right corner of the page.

  • On merge requests, these buttons are located to the far right of the tabs.
  • On issues, incidents, and epics, these buttons are located at the top of the right sidebar.

Related topics

  • Review a merge request
  • Authorization for merge requests
  • Testing and reports
  • GitLab keyboard shortcuts
  • Comments and threads
  • Suggest code changes
  • CI/CD pipelines
  • Push options for merge requests

Help & feedback

Edit this page to fix an error or add an improvement in a merge request.

Create an issue to suggest an improvement to this page.

Create an issue if there's something you don't like about this feature.

Propose functionality by submitting a feature request.

Feature availability and product trials

View pricing to see all GitLab tiers and features, or to upgrade.

Try GitLab for free with access to all features for 30 days.

If you didn't find what you were looking for, search the docs .

If you want help with something specific and could use community support, post on the GitLab forum .

For problems setting up or using this feature (depending on your GitLab subscription).

Merge methods

Configure a project’s merge method, merge commit, merge commit with semi-linear history, fast-forward merge, rebasing in (semi-)linear merge methods, rebase without ci/cd pipeline, related topics, help & feedback, feature availability and product trials.

For problems setting up or using this feature (depending on your GitLab subscription).

assign merge request gitlab

IMAGES

  1. Reviewing and managing merge requests · Merge requests · Project · User

    assign merge request gitlab

  2. Add-merge-request · Gitlab-basics · Help · GitLab

    assign merge request gitlab

  3. Merge requests

    assign merge request gitlab

  4. Feature Highlight: Merge Request Approvals

    assign merge request gitlab

  5. How GitLab developers can merge any branch into master

    assign merge request gitlab

  6. How to make a MERGE REQUEST on GitLab?

    assign merge request gitlab

VIDEO

  1. Fix trailing space in a merge request

  2. Design: Group level merge request approval rules (all protected branches)

  3. What is a Pull Request ? or Merge Request in Git, Github? #git #codingeducation #github

  4. GitHub Importer

  5. Security Reports Merge Request Widget Demo

  6. Primer merge request en GitLab

COMMENTS

  1. Merge requests

    Select Code > Merge requests and find your merge request. On the right sidebar, expand the right sidebar and locate the Assignees section. Select Edit and, from the dropdown list, select all users you want to assign the merge request to. To remove an assignee, clear the user from the same dropdown list.

  2. Creating merge requests

    To create a merge request by sending an email: On the left sidebar, select Search or go to and find your project. Select Code > Merge requests . If the project contains any merge requests, select Email a new merge request to this project . In the dialog, copy the email address shown.

  3. gitlab merge request. Who is the assignee?

    2. The people who are assigned to a merge request are the people who are responsible for it, not in a review kind of sense. Usually it is the person who creates the pull request who counts as responsible for it i.e. has the responsibility of merging when all reviewers are happy and have approved or making changes according to the reviewers ...

  4. Creating merge requests

    From the merge request list. You can create a merge request from the list of merge requests. On the left sidebar, select Search or go to and find your project.; Select Code > Merge requests.; In the upper-right corner, select New merge request.; Select a source and target branch, then select Compare branches and continue.; Complete the fields on the New merge request page, then select Create ...

  5. GitLab Merge Request Assignee: What It Is and How to Use It

    Open the merge request in GitLab. 2. Click the Assign button. 3. Enter the username of the user you want to assign the merge request to. 4. Click the Assign button. Q: How do I remove a merge request assignee? To remove a merge request assignee, you can do the following: 1. Open the merge request in GitLab.

  6. Working with GitLab Merge Requests

    Assign the merge request to the appropriate reviewer(s) and add any necessary labels or milestones. Submit the merge request and wait for the reviewer(s) to provide feedback. ... Yes, you can add reviewers to a merge request in GitLab. When creating or editing a merge request, you can specify one or more reviewers who will be notified and asked ...

  7. Getting started · Merge requests · Project · User · Help · GitLab

    A merge request (MR) is the basis of GitLab as a code collaboration and version control. When working in a Git-based platform, you can use branching strategies to collaborate on code. ... or by using keyboard shortcuts for merge requests: Assign the merge request to a colleague for review.

  8. Index · Merge requests · Project · User · Help · GitLab

    When you create a merge request, GitLab checks for the existence of a description template to add data to your merge request. GitLab checks these locations in order from 1 to 5, and applies the first template found to your merge request: ... To assign the merge request to a user, use the /assign @user quick action in a text area in a merge ...

  9. Merge requests workflow

    If a merge request coach is going to finish the merge request, we assign the ~coach will finish label. When a team member picks up a community contribution, we credit the original author by adding a changelog entry crediting the author and optionally include the original author on at least one of the commits within the MR.

  10. Creating merge requests · Merge requests · Project · User · Help · GitLab

    Changed the behavior of the Create merge request button to open the merge request creation form in GitLab 14.8. If your development workflow requires an issue for every merge request, you can create a branch directly from the issue to speed the process up. The new branch, and later its merge request, are marked as related to this issue.

  11. How to Conduct Code Reviews with GitLab's Merge Requests

    You can complete an initial review without submitting your MR. Use the "Commits" and "Changes" tabs to confirm you've included the correct code. Once you're ready, hit the green "Submit merge request" button to open the MR. You can view all the MRs in your project using the "Merge Requests" link in the sidebar.

  12. Creating merge requests · Merge requests · Project · User · Help · GitLab

    On the New Merge Request page, start by filling in the title and description for the merge request. If commits already exist on the branch, GitLab suggests a merge request title for you: If a multi-line commit message exists: GitLab adds the first line of the first multi-line commit message as the title. Any additional lines in that commit ...

  13. Merge request approvals

    While GitLab Free allows all users with Developer or greater permissions to approve merge requests, these approvals are optional . GitLab Premium and GitLab Ultimate provide additional flexibility: Create required rules about the number and type of approvers before work can merge. Specify a list of users who act as code owners for specific ...

  14. Reviewing and managing merge requests (FREE)

    Feature flag removed in GitLab 13.7. For larger merge requests, consider reviewing one file at a time. To enable this feature: In the top-right corner, select your avatar. Select Preferences. Scroll to the Behavior section and select Show one file at a time on merge request's Changes tab. Select Save changes.

  15. Getting started · Merge requests · Project · User · Help

    From a merge request, expand the right sidebar and locate the Assignees section. Click on Edit and from the dropdown menu, select as many users as you want to assign the merge request to. Similarly, assignees are removed by deselecting them from the same dropdown menu. It is also possible to manage multiple assignees:

  16. Index · Merge requests · Project · User · Help · GitLab

    When you create a merge request, GitLab checks for the existence of a description template to add data to your merge request. GitLab checks these locations in order from 1 to 5, and applies the first template found to your merge request: ... To assign the merge request to a user, use the /assign @user quick action in a text area in a merge ...

  17. Generated by PLCFactory on 2024-04-11 13:38:28 (!12) · Merge requests

    Date: 2024-04-11 13:38:28 PLCFactory URL: https://gitlab.esss.lu.se/icshwi/plcfactory.git PLCFactory branch: master PLCFactory commit ...

  18. Gitlab: How to automatically add code reviewers to your merge ...

    1. Create a new Gitlab group or a subgroup of an existing group and add code reviewers to the group. You can skip this step if you already have a group or wish to hard-code the reviewer IDs in the ...

  19. Connect issues to merge requests

    If a contributor forgets to link an issue, we just edit the Merge Request description to include the issue ID (For example, "Closes #31074 (closed) ") and save. The issue will be updated with a reference to the Merge Request and the Merge Request widget will display that Accepting the Merge Request will close that issue. 2.

  20. Refactor ci: aligning deployment methods to a single one

    GitLab. Explore; Sign in; Register oai; openairinterface5G; Merge requests!2674; ... Changes 31; Expand Merge request reports Assignee Select assignee. Assign to. Reviewers Request review from. Request review from. Time tracking ...

  21. How to create a GitLab merge request via command line

    123. As of GitLab 11.10, if you're using git 2.10 or newer, you can automatically create a merge request from the command line like this: git push -o merge_request.create. More information can be found in the docs. edited Nov 30, 2019 at 15:19. mcw.

  22. CMakePackageConfigHelpers: Restore undocumented PACKAGE_PREFIX_DIR

    A GitLab update will be applied on April 12th, between 8am and 10am, EST (UTC-05:00). This site may have intermittent delays during that time. ... Merge request reports Assignee Select assignee. Assign to. Reviewers Request review from. Request review from. Time tracking ...

  23. Merge requests

    Merge requests. DETAILS: Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated. A merge request (MR) is a proposal to incorporate changes from a source branch to a target branch. When you open a merge request, you can visualize and collaborate on the changes before merge. Merge requests include: A description of the ...

  24. Chain multiple merge requests together in GitLab

    4. We also have this problem from time to time. You can mark the frontends' merge request as work in progress by adding WIP in the beginning of the merge requests title. This will prevent the it from being merged. However, you have to remove the WIP manually when the API merge request is merged.

  25. Merge methods

    On the left sidebar, select Search or go to and find your project. Select Settings > Merge requests . Select your desired Merge method from these options: Merge commit. Merge commit with semi-linear history. Fast-forward merge. In Squash commits when merging, select the default behavior for handling commits: