Skip to content

Merge Requests


Available in all GitFlic versions

Merge requests are the main tool for introducing changes from a source branch into a target branch. When reviewing a merge request, you can visualize and collaboratively discuss changes before applying them. Merge requests allow you to use many auxiliary tools to build a high-quality workflow.

A merge request contains the following information:

List of merge requests

Creating a Merge Request

There are several standard ways to create a merge request from the branch where the work was done:

Creating a Merge Request from a Project Branch

To create a new merge request from a working branch of the project, go to the merge requests page and click the Create button. In the window that opens, fill in the following fields:

  • Source - The source project and branch from which the merge request will be created. Changes from the source branch will be transferred to the target after merging. By default, the current project and working branch are specified. You can also select a fork as the source project.
  • Target - The target project and branch where the merge request will be created. Changes from the source branch will be transferred to the target branch after merging. By default, the current project and working branch are specified.
  • Title - A brief description of the merge request. Cannot exceed 100 characters.
  • Description of changes - A detailed description of the changes, where you can attach images or links. The merge request description block supports text formatting in Markdown format.
  • Approvers - A list of project members with a role no lower than Developer who, in the author's opinion, should approve this merge request before merging.
  • Reviewers - A list of project members with a role no lower than Developer who, in the author's opinion, should ensure the proposed changes are correct.
  • Labels - Tags specifying the category of the merge request. By default, each project has a standard set of labels: feature, bug, urgent fix, and release. You can change the set of labels in the project settings.
  • Related issues - A list of issues that are linked to this merge request.
  • Merge request lock - A feature that allows you to temporarily block the merge request from being executed. The field for describing the reason for blocking is available after activating the feature.
  • Delete source branch - A feature that allows you to automatically delete the source branch after the merge request is completed.
  • Squash merge - A feature that allows you to merge the request as a single commit (squash commit).

Creating a merge request

Creating a Merge Request from a Fork

If a user does not have sufficient rights to create merge requests in the main project, they can create one through a fork. To do this, on the merge requests page of the fork, click the Create button. In the form that opens, specify the main project as the target project. After filling in the required fields and clicking Create, the new merge request will appear in the main project.

If a merge request resolves an issue, use the corresponding field to link them. You can link an issue when creating or editing an existing merge request. You can link up to 10 issues to a single merge request.

Viewing Merge Requests

The list of all merge requests is displayed in the corresponding project tab. Filters and a search bar by title help you find the desired request. To view details, click on its title. The window that opens will display the full description, list of approvers, creation and update times, and other useful information. To change any information, use the edit function, available to the author and project administrators.

Deleting merge requests.

Deleting merge requests is not available. Instead, you can Revert or Close a request.

In the discussions section, any authorized user can share their opinion on the proposed changes. You can leave a discussion on a specific line in the changes of the merge request. A discussion can be deleted by its author or a project administrator. Each open discussion blocks the merge request from being merged. Once a discussion is no longer relevant (for example, if the mentioned issues have been fixed), it should be closed using the appropriate button. A discussion can be closed by its author or any project member with a role no lower than Developer.

Editing discussions.

Editing discussion text is not available.

Discussions

Additionally, other sections of the merge request contain useful information:

Commits

A list of all commits that will be transferred from the source branch to the target branch.

Commits

Pipelines

A list of all pipelines associated with the merge request. The following pipelines will appear in this section:

Pipelines in merge requests from a fork

If a merge request is created from a fork, the merge result pipeline will be created in the main project. Other types of pipelines will be created in the fork.

Pipelines

Security

Feature available in the Enterprise version

SAST and DAST reports generated as part of pipelines associated with the merge request.

Security

Changes

A list of files that have changed as part of the merge request. Two display formats are available: inline and side-by-side. In the side-by-side format, you can view the author of each line (blame).

Changes

Resolving Conflicts

If there are conflicts in the merge request, merging becomes impossible. Conflicts can be resolved locally using the command line or IDE. Additionally, conflicts can be resolved via the GitFlic web interface. To do this, click the Resolve conflicts button.

Conflict resolution unavailable.

If conflicts arise due to file deletions, resolving them via the web interface becomes unavailable.

Conflict resolution button

The conflict resolution form displays two versions of the files: one from the source branch, the other from the target branch. To select the part of the code to merge, click the arrow button. The selected changes will be transferred to the right side. The left side displays a menu with all files where conflicts were found between the two branches. After finishing with the conflicts, click "Apply" at the top of the page and then "Commit". The commit will be created in the source branch.

Conflict resolution form

If you continue working with the local branch, run git pull.

Completing a Merge Request

All conditions must be met to complete a merge. The list of conditions can be changed in the merge request settings:

  • Merge request is not locked - A locked request cannot be merged. You can unlock it during editing.
  • Merge permissions - Merging is available to project members with the Developer role or a custom role with merge permissions.
  • Merge request has no conflicts - Merging a request with conflicts is not available. Conflicts must be resolved locally or using the web interface.
  • No files locked by other users - If the list of changed files contains files locked with git lfs lock in a local repository, only the user who locked the files can merge the request.
  • Branch is up to date - There must be changes between the source and target branches to complete the merge.
  • Pipeline for the latest commit completed successfully - This condition can be enabled in CI/CD settings. The pipeline for the latest commit must have a Success or Warning status.
  • Merge result pipeline for the latest commit completed successfully - This condition can be enabled in CI/CD settings. The merge result pipeline for the latest commit must have a Success or Warning status.
  • Merge pipeline for the latest commit completed successfully - This condition can be enabled in CI/CD settings. The merge pipeline for the latest commit must have a Success or Warning status.
  • Merge permissions for protected branch - You must have a sufficient role according to the branch protection rules.
  • Required approvals from approvers received - This condition is met only if there are enough approvals from Approvers.
  • Required approvals from code owners received - This condition is met only if there are enough approvals from Code Owners.
  • Source branch needs to be rebased - This condition may appear if the merge method semi-linear history is selected. You can rebase using the button in the web interface. If there are conflicts, the rebase button will not be available until conflicts are resolved.

If necessary, any request can be Closed or Reverted. Such requests cannot be reopened.

Merge conditions

Merging Using Merge Trains

Feature available in the Enterprise version

To merge several requests into one target branch with an automatic conflict checking mechanism, use the Merge Trains feature. Learn more about this functionality here.

Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.