Skip to main content

Pull Request vs Merge Request

Merge Request

Simplified Git Flow

After changes to a Branch are finished they are Merged into another Branch. This enables you to essentially replay all the changes Committed to a Branch on another Branch to contribute those changes; generally by merging a “child” Branch back to it’s “parent” Branch.

Example steps of the Simplified Git Flow

Let’s take a team working on a Project that has 2 members, John and Sarah. Git is the version control system being used, and the Project is comprised of a single Repository with a Branch named “master” that is used to maintain the source code files for the Production deployment of the Project.

  1. The “master” branch is used to track the source code that gets deployed to the Production environment for the project
  2. When either John or Sarah begin working on a feature, they each create a new branch to work within.
  3. When working on that feature, they Commit their changes into that Branch.
  4. Then when they’ve finished working on the feature, they test their changes by compiling the source code and running it locally as well as in a test environment.
  5. Then once testing is completed, they merge their changes from their “feature” Branch into the “master” branch to contribute it back up the chain.
  6. Then testing is completed with the new changes merged into “master”.
  7. Once testing and validation has completed, the latest code in “master” is deployed out to Production and the new feature become live in the project.
  8. After all this, the feature Branch is then deleted to clean up the repository and keep any branches from cluttering things up and confusing future development work later on. Also, changes made have been recorded in “master” so the history of the Branch is no longer necessary.

Pull Request

A pull request is a proposal to merge a set of changes from one branch into another. In a pull request, collaborators can review and discuss the proposed set of changes before they integrate the changes into the main codebase. Pull requests display the differences, or diffs, between the content in the source branch and the content in the target branch. --GitHub

GitHub Flow

Pull Requests are something that GitHub has created in their system that implements and supports Git. By doing this, they’ve added another couple steps in the middle of the Simplified Git Flow, to create what is called the GitHub Flow.

Conclusion

They both mean the same thing, GitHub calls it pull requests while GitLab calls it merge requests.

Merge or pull requests are created in a git management application and ask an assigned person to merge two branches. 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. In this article we’ll refer to them as merge requests.

Reference

https://build5nines.com/introduction-to-git-version-control-workflow/