Pull Requests

September 10, 2019

When you fork a repository to experiment/extend a project on your own, you might run into one of the following cases:

  • Case 1: You would like to see your extension merged into the original project;
  • Case 2: You would like to get the latest update from your original project;

In both cases, you want to execute a pull request, i.e. asking the maintainer of the original repository to pull code from your repository or (asking yourself) to to pull code from the original repository.

Go to your repository on GitHub and click on ‘Compare’, below the green button.

Pull Request - Compare

In the next step, select the source from where to pull the code (on the right) and the destination where to push the code (on the left). If you want to catch up with the code from the original repository (as shown below), the original repository is the source while your repository is the destination (Case 2). Simply inverse those if you want to share your code on the original repository (Case 1).

Pull Request - Source and Destination

In the next step, you write a short message to explain the purpose of this pull request. This message is more important if you want to share your code (case 1) to motivate why the maintainer of the original repository should merge your code.

Pull Request - Purpose

The last stage is about accepting the pull request. In case 2, you are the one clicking on ‘Merge pull request’ (as shown below). In case 1, the maintainer of the original repository receive a message to accept or reject the pull request.

Pull Request - Accept

Twitter, Facebook