Get startedGet started for free

Pull requests

1. Pull requests

Well done on working with issues. People are going to love collaborating with us on GitHub! We know how to communicate on GitHub. Now we’ll review how to implement changes through a pull request, also known as a PR.

2. What is a PR?

A PR is a way to notify others about changes we would like to make to a branch within a repo. It also allows the repo owner to check the changes before they are added. It is best practice to add changes to a separate branch from the default main branch. This ensures that main only contains finished work. Finally, the aim of a successful PR is to merge two branches.

3. Make a pull request

We already have a branch for the task we are working on in our forked repo and have made our updates. We now want to merge the changes to the main repo with a PR. Here we are on the page for the update_readme branch on the forked repo.

4. Make a pull request

We navigate to the Pull requests tab.

5. Make a pull request

and click on the New pull request button.

6. Comparing changes

This next step is important. The base branch is the branch we want to add our updates to, while the compare branch is the branch that contains our updates.

7. Comparing changes

We check these are correct, and then GitHub will tell us if we have any conflicts. Thankfully, we don’t!

8. Comparing changes

We click Create pull request.

9. Fill in a pull request

Now it’s time to add some information about the changes we want to make. We add a title, Update README. We also have the option to add a longer description; we add a short sentence: Adding title and short description.

10. Assign a pull request

We can assign a PR to a specific user the same way we assign an Issue.

11. Create pull request

And lastly, we click Create pull request.

12. Let's practice!

Let’s practice making some PRs before learning how to review them.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.