Create and merge GitLab merge requests
Enable the Git plugin
This functionality relies on the Git plugin, which is bundled and enabled in DataGrip by default. If the relevant features are not available, make sure that you did not disable the plugin.
Press Ctrl+Alt+S to open settings and then select .
Open the Installed tab, find the Git plugin, and select the checkbox next to the plugin name.
Install the GitLab plugin
This functionality relies on the GitLab plugin, which you need to install and enable.
Press Ctrl+Alt+S to open settings and then select .
Open the Marketplace tab, find the GitLab plugin, and click Install (restart the IDE if prompted).
GitLab merge requests are used in open-source projects or in some corporate workflows to manage changes from contributors and to initiate code review before such changes are merged.
When you create a merge request, you tell others about the changes you want to push to the original repository. The maintainers of that repository can then review your changes, discuss them, and integrate them into the base branch.
As a merge request author, you can manage your merge request lifecycle directly within DataGrip:
Create a merge request.
View details of your merge request in the Merge Requests tool window.
Merge or close your merge request.
Create a merge request
In the main menu, go to .
In the Merge Requests tool window that opens, click
Create Merge Request in the top-right corner.
A new tab opens with a merge request draft.

Click the name of the base repository on the left and specify the branch that will receive the updates.

Click the name of the head repository on the right and specify the branch with the changes that will be added to the base repository.

If you have a project that uses multiple remote repositories, you can change the head repository in this popup as well.
Specify the name for your merge request in the Title field, and, optionally, provide a description of the changes to be applied through your request and add reviewers.
Click Create Merge Request.
View details of your merge request
After creating a merge request, you can always find it in the Merge Requests tool window.
To open the Merge Requests tool window, click in the tool window bar on the left.

Alternatively, go to in the main menu.
Use the Merge Requests tool window to:
Filter requests by state, author, assignee, reviewer, and label.
Jump to a merge request on GitLab: right-click a merge request and choose Open Merge Request on GitLab from the context menu.
When you double-click a merge request from the list, you can see the overview and timeline tabs.

In this view, you can:
View the timeline of a selected merge request to track its progression and leave comments for the whole merge request.
Select a particular commit to filter the list of changes.
Create a local branch based on incoming changes: open a merge request, click the branch with incoming changes, and choose Checkout 'branch name' in the context menu.
Investigate branch-related changes in the Log tab of the Git tool window: open a merge request, click the branch with incoming changes, and choose Show 'branch name' in Git Log in the context menu.
This will help you navigate the code related to this merge request, make sure the project builds and the tests pass.
To learn about more options, refer to Give feedback to a merge request.
Work with received feedback
If someone left comments to your merge request, you can resolve them or leave your answers directly in DataGrip.
In the main menu, go to or click
in the tool window bar on the left.
Select the merge request from the list and double-click it. DataGrip opens an overview of the selected merge request.
Click the branch with incoming changes and choose Checkout 'branch name' in the context menu.

By checking out the branch, you get the full context to test the incoming changes and check how they work.
After the successful checkout, DataGrip starts the Review mode. That means you can see the highlighted changes and comments not only in the Diff tab (Ctrl+D), but right in the editor (F4).
Select the file you want to investigate, right-click it and select Jump to Source F4 from the context menu.
In the file that opens, pink markers in the gutter indicate the changes and the comments that are available for review.
You can resolve a comment, reply to it, or leave your reaction.
After you finished working on the merge request, you can re-request review, merge, or close it in the same merge request details tab.
Merge or close a merge request
If you have the necessary permissions assigned by the repository owner, you can merge your merge request when work is complete.
In the main menu, go to .
In the list of merge requests, select the one you want to work with and double-click it.
At the bottom of the overview, there is a button with merge options that differ depending on the stage of the review process and your permissions.
If you have approved the updates after the review, you can merge the merge request by clicking Merge.
For more merge options, click
and select Squash and Merge to squash the commits with your changes into one before merging them.
Click
More and select Request Review if you need another opinion on this merge request or Close Merge Request if you do not want to merge it.