1

I'm using gitlab and I just configured that in order to push to master, a merge request must be created BUT I don't want the merge request creator to be able to merge the request himself.

I want all the members in my team to be able to create merge request and approve merge request to other members in the team but not to themself

How can I do it?

Tal Levi
  • 363
  • 1
  • 6
  • 22
  • If you mean literally you don't want the author of an MR to be able to press the 'merge MR' button (implicitly, of an MR they wrote and someone else approved) - please edit the question to explain why as that's quite atypical. – AD7six Apr 09 '23 at 14:00
  • That's exactly what I'm trying to do. I want all the members in my team to be able to create merge request and approve merge request to other members in the team but not to themself – Tal Levi Apr 10 '23 at 07:09
  • Have I already answered your question, I’m unsure? It’s confusing for me because approvals and who-can-merge are two different (but related) concepts, again: please edit the question to clarify what you are asking about. “Everyone can merge any mr except their own” (what you are describing in comments, having said my first comment is exactly what you are trying to do) is a very odd workflow. – AD7six Apr 10 '23 at 10:11

1 Answers1

3

In the repository settings (http://example.com/repo/name/-/settings/merge_requests) you can Prevent approval by author:

Prevent approval by author settings in gitlab

That does exactly what it says - a MR must be approved by not-the-author before the author can merge their own MR. As shown in the above screenshot, there are other controls that prevent trivially bypassing the approval rules.

AD7six
  • 63,116
  • 12
  • 91
  • 123