0

Why Gitlab automatically merge target branch into source branch when you approve a merge request? How to disable this behaviour?

murrometz
  • 904
  • 1
  • 8
  • 12

2 Answers2

0

There is no functionality to disable this. However, you can block the MR from being merged accidentally.

Find below some options to block the MR from being merged:

  • Merge request approvals

https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_approvals.html

  • WIP merge requests

https://docs.gitlab.com/ee/user/project/merge_requests/work_in_progress_merge_requests.html

  • Only allow MR to be merged if all discussions are resolved

https://docs.gitlab.com/ee/user/discussions/index.html#only-allow-merge-requests-to-be-merged-if-all-discussions-are-resolved

Sourav
  • 3,025
  • 2
  • 13
  • 29
0

You can't and ideally you shouldn't. I also faced this issue but it was only in the case when there was a merge conflict. And in that case, it makes sense to merge the target into source. Why? Because since there are conflicts, you will need to bring the changes from the target into source(conflict resolution) and then move forward. Hope this helps. If this is not clear, let me know. I can explain more.

vamosromil
  • 23
  • 6