GitHub has been spending a lot of time over the past few years improving their features above and beyond source control. One of the areas they have invested in is Pull Requests. I’ll start by assuming that you have a branch in GitHub and changes have been pushed to that branch.

Start a Pull Request on GitHub

Once you see this dialogue, this means that there are differences between the master and your branch.

GitHub will be renaming master to main soon. At the time of this post, master was still the default.

If you choose the Compare & pull request button, the Open a pull request window will appear. This will allow you to see the number of commits, files changed, and contributors for the pull request you are creating. It’s recommended that you add a title and document the pull request so the reviewers will know what is changing.

Open a pull request window

You’ll also notice that GitHub will check to see if the branch changes are able to merge into the master branch. As you can see, my request can merge successfully. After pressing the Create pull request button, I can proceed. However, I know that my repository is tied to a GitHub Action that will process every commit and pull request to ensure its safe to continue and deploy. It does this using Travis. I posted about this back in May. So, I’ll wait approximately 1-2 minutes for the action to complete. While I’m waiting, I can see that the action is performing the check.

Travis-CI checking the Pull Request

Once the request is complete, and I’m all green, I know it’s safe to proceed.

Travis-CI successfully checked the Pull Request

I can now choose to Merge pull request. When I choose that, I’ll be asked to Confirm merge. After the merge is successful, I’ll receive the response back and will now be allowed to safely Delete branch. This will allow me to delete the branch that I was working from. I can ignore this if I still need it.

GitHub Merge was completed and now I can delete the branch

If I choose to delete the branch, I can always restore it.

Restore a branch in GitHub's Pull Request window

Summary

Hopefully this provided a good overview of the pull request process in GitHub. I’ll use what I’ve covered above in future posts.