On services offering cloud Git repositories, I always find merge requests. What is its purpose? Who was supposed to create it?
Also, what+s the lifecycle of a merge request? Someone creates it, and then - what cycles it should pass?
A merge request (MR) is a request from someone to merge in code from one branch to another. You can create a MR from Assembla by clicking on New Merge Request, which is in almost all of git sub-tabs. You'll be asked to select a “From” branch and a “To” branch.
A Git pull request is essentially the same as a Git merge request. Both requests achieve the same result: merging a developer's branch with the project's master or main branch. Their difference lies in which site they are used; GitHub uses the Git pull request, and GitLab uses the Git merge request.
A merge request is a regular review moment to check if your teammates still have the same standards and values about testing, quality and code style. It also ensures that these are and remain uniform within the project. It is important that the team is aware that a review is meant to improve together.
Merge Request and Pull request basically refers to same thing. Tools such as GitHub and Bitbucket choose the name pull request since the first manual action would be to pull the feature branch. Tools such as GitLab and Gitorious choose the name merge request since that is the final action that is requested of the assignee.
Pull/Merge requests are created if you are working in a feature branch and wants to merge your change in main branch(eg. Master branch). The merge requests serves as a code review tool and if your code reveals shortcomings/issues anyone(usually other developers) can commit and push a fix.
Life cycle : You create a branch, fix some issue or add a feature, create a pull/merge request, then you assign it to someone, he/she will review your fix and can accept/reject the pull/merge request.
Please note that a merge/pull request should not be confused with the "git merge" or "git pull" command.
I believe you are referring to pull requests (PR) which you merge into your master branch. Pull requests are the standard way of people who have branched off (forked) your code to then commit back to the master branch. Generally one PR should solve one bug or add one feature. This is usually achieved using feature branches on the forked code and then creating a pull request on that branch when the feature is completed. This makes merging much easier and means that if you work on multiple features and one is rejected but the other is accepted, their branches do not collide.
So to answer your question of who is supposed to create them, it is usually people who have forked your code. This may even be people on your development team if that's how you choose to work. The main area where this works is with public open source projects. For example, openssl has a public github that anyone can fork, and then if someone wanted to add a feature or fix a bug they would: fork, branch, commit, push and submit a PR.
Once a PR is created, the lifecycle it takes is down to you. It is not predefined. In general the least you must do is: decide if the bug or feature is worthwhile, check over the code to ensure it does what it says and is well written and meets any coding standard set out for your project and then if it good, accept it and merge it.
You can make the lifecycle more complicated by having it go to a development branch to be tested by testers with other development features before being merged into the master but really it is down to you to find a workflow that works for your project.
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