I'm using Gitlab.
I created an issue and then used the "create branch" button in the issue view page.
I worked on the branch and completed and committed around 80% of work.
When I created a merge request from this branch to master and accepted it, the issue was closed automatically.
What was I supposed to do to accept the merge request without closing the issue?
Or maybe it's a git concept that you should merge a branch only when the issue is complete resolved?
There's no problem in deleting branches that have been merged in. All the commits are still available in the history, and even in the GitHub interface, they will still show up (see, e.g., this PR which refers to a fork that I've deleted after the PR got accepted).
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.
Merging Branches. Once you've completed work on your branch, it is time to merge it into the main branch. Merging takes your branch changes and implements them into the main branch. Depending on the commit history, Git performs merges two ways: fast-forward and three-way merge.
Gitlab analyses the commit messages of all commits on the default branch, which is most of the time the master branch.
If it detects an issue pattern, e.g. fixed #<issue number>
, in a commit message, it will close this issue. Git handles also merges with commits, to be more specific by default it will create a merge commit.
Now to the merge request:
If you create a merge request in Gitlab from such kind of specific issue branch, it will automatically fill the commit message with a reference to the source issue. To prevent this you have to delete the commit message before merging.
See the link on the right side which reads Modify Commit Message
, there you will find the pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With