Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closing gitlab merge request

We are using Gitlab (the gitlab.com free version). My colleague is creating merge requests and we are merging from one branch (development) into another (master). When my colleague merges into master the MR is shown as Merged. I am then running some tests on the merged branch (not done automatically through GL currently) and when happy with the merge I am wanting to close the merge request. However I do not have any option to close it - I do not have a close button and if I type /close in the comments it does not do anything. Neither my colleague or myself are able to close the MRs. We both have Master status and have tried changing various MR project settings but to no avail. PLease can anyone help?

like image 376
Hels Avatar asked Apr 11 '17 08:04

Hels


People also ask

What happens when you close a merge request in GitLab?

In Gitlab, the merged status means the relevant commits have been merged and no action is needed. A closed merge request is one that has been put aside or considered irrelevant. It is therefore not merged into the code base.

Does a merge request delete the branch?

But in general, topic branches are deleted after merging. This ensures that there is a merge point and a record of the merge occurring. Is a tag for every branch a bit redundant?

Why does GitLab call it merge request?

Git merge requests (MR) are the foundation of the GitLab version control platform. They are called merge requests because their final action is merging the branch with the main feature branch. Git merge combines changes into one consistent tree, just one part of what Git pull does.


2 Answers

In Gitlab, the merged status means the relevant commits have been merged and no action is needed.

A closed merge request is one that has been put aside or considered irrelevant. It is therefore not merged into the code base.

Therefore, you only merge MRs when you're happy with the changes and close them if you think the changes are not worthy of being integrated into the code base ever.

A typical workflow would be the following:

  • User A works on a new feature in a feature branch and pushes their work to that branch.
  • They can open a merge request to merge their feature branch into master.
  • User B pulls the feature branch, eventually rebasing it onto master, and runs the tests they want.
  • If User B is happy with the changes/new feature, they can merge the MR into master (or whatever branch you merge into)
  • The merge request will be shown as merged

Of course it's better if the tests run automatically in a CI.

like image 160
Jawad Avatar answered Oct 18 '22 05:10

Jawad


With GitLab 12.2 (August 2019), you have new options which could help indicate the "closed" status of a merge request.

See "New push options for merge requests"

In GitLab 12.2, GitLab has been taught new push options to:

  • Set the branch to be removed when it is merged.
  • Change the merge request’s title.
  • Change the merge request’s description.

See issue and documentation

like image 42
VonC Avatar answered Oct 18 '22 04:10

VonC