GIT: Whats the Difference between a Pull Request and a Merge?

xRavisher picture xRavisher · Jan 21, 2014 · Viewed 23k times · Source

On services like bitbucket and github you have the option to create a pull request..

My question to you (developers), is what are all of the differences between the two?

Differences I currently know of:

  • Ability to approve or reject request
  • Ability to provide add a descriptive message with the request

Other than that it seems like a pull request is just essentially a merge.. correct?

Answer

First Zero picture First Zero · Jan 21, 2014

Yes that is correct, the pull request on GitHub and Bitbucket is a request to merge two branches.

One of the use cases is to have a QA person who is not the developer review and approve the merge request.

Another use case is development on master branch is not allowed. A developer always develop on another branch. Once the development is completed, a pull request is created to merge into master branch.