How to remove merge request from GitLab server

Sanj picture Sanj · Aug 25, 2015 · Viewed 53.3k times · Source

I created a merge request on gitlab (local) server. Now whenever I click on the merge request, the request times out with error 500. Before that I used to get an error code 504 and I applied the change mentioned in this gitlab support topic.

All I want to do is remove the merge request. Is there a manual way of doing this?

Answer

Eric D. Johnson picture Eric D. Johnson · Apr 11, 2018

Web UI Option

Today I discovered a way to do this with the Web UI.

So for Merge Request 14

https://gitlab.example.com/MyGroup/MyProject/merge_requests/14/edit

On the bottom Right you should see a red Delete button.

Gitlab Delete Merge Request Screen Shot

PowerShell Option

Invoke-RestMethod -Method Delete -Uri 'https://gitlab.example.com/api/v4/projects/PROJECT_ID_GOES_HERE/merge_requests/14' -Headers @{'PRIVATE-TOKEN'='PRIVATE_TOKEN_GOES_HERE'}