Skip to content

Exercise Making a Pull Request

Robert Adams edited this page Sep 8, 2018 · 8 revisions

Prerequisites

What is a pull request?

Whenever you fork a repository on github, you can make changes to your repository and the request that the author of the original repository merge your work back into the original repository. You want the author to pull from your fork of their repository, and these requests are called pull requests. These are unique to github.

Github provides great features for commenting on a pull request, code reviewing a pull request, and summarizing the commits and changes. As an example of what you can do with a pull request, see my example pull request.

Commenting: commenting

Create your own pull request!

Create a new branch for the pull-request

First, let's make a new branch to keep track of our pull request. In bootcamp-git:

git checkout master
git checkout -b pull-request
git push origin pull-request

This will create a new branch called pull-request, and then push this to a new branch on github called pull-request. If you go to the web version of your github repository, you should see it listed under branches at the top.

Create a pull request

In your own github repository, click "Pull Requests" on the right.

pull request button

Now click "New Pull Request".

new pull request

Click edit, and provide these options:

  • For base fork, choose hcs/bootcamp-git and base:master
  • For head fork, choose YOUR-USERNAME/bootcamp-git and compare:pull-request

pull request options

Then hit "Create pull request", and you've created your first pull request!

Comment on your pull request

You can leave comments, leave in-line notes on your code, and more!

NOTE: If you make new commits on top of pull-request and push it to github, then the pull request will automatically reflect the new commits!

Find a partner

Find a partner, and send each other links to your pull requests. Have fun commenting!

Note about future bootcamps

In the future, we may have you work on code for assignments. We'll use pull requests so that we can give you code reviews and give you feedback.

Finish Bootcamp

Go back to the main page.