Exercise Making a Pull Request
- Make sure you've done our Github forking exercise
- Make sure you've done our Committing and pushing exercise
- Make sure you've done our Resolving merge conflicts exercise
- Make sure you've done our Reverting a commit exercise
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.
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
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.
Now click "New Pull Request".
Click edit, and provide these options:
base fork, choose
head fork, choose
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.
Go back to the main page.