A Pull Request is a request to merge one branch into another branch.

Pull Requests are basically change proposals, they are used to propose changes to the project files.
In other words, they’re a way to start a discussion about commits and are often used for code review.

 

Before a Pull Request

To open a pull request, you must first have a branch with changes on it that you can propose to be added to another branch (e.g. typically the master branch).

 

Open a Pull Request

  1. Compare & Pull Request
    You start by clicking the green “Compare & pull request” button in the image above.
  2. Pull Request Page
    It takes you to the “Open a pull request ” page.
  3. Compare Branches
    Use the drop-down menus to select any two branches for comparison.
  4. Message
    In the body of the message, we’ll create a message and reference the original issue with the number notation.
    Type: “Fixes #1”. In other words, this Pull request fixes the first issue.
    Feel free to elaborate further; “Added a readme file so people will know what this readme is about.”
  5. Submit Request
    Press the “Create pull request” button.

 

Conversation View

After the pull request, you’ll be taken to what’s called the Conversation View where collaborators can discuss the new proposed changes. You can add additional comments to the pull request.

The File Changed view shows the ‘diff’, highlighted in green and red for additions and subtractions.

 

Merge Changes

In the Pull Request view you can merge the changes yourself if you have the user privilege to sign-off on the change.
If you merge the pull request it will add the changes back to the master branch.