This guide describes how to create a Pull Request (PR) on GitHub.

Note: This guide assumes that any additions/ changes you made to a file in your local repo have been saved, staged, committed, and pushed to GitHub using the guide Send (push) files.

General information about pull requests is available from the guide Pull requests overview.

Topics in this guide

Create a pull request on GitHub

Complete the following steps to create a pull request on GitHub.

  1. In a web browser, sign into GitHub, and go to the project’s GitHub repository (repo).

    For example, in the following image, the repo test-repo is open on GitHub.

    Example GitHub repo in a web browser

  2. On GitHub, select the Pull requests tab.

    'Pull requests' tab on GitHub

  3. In the GitHub Pull requests tab, choose New pull request.

    'New pull request' button on GitHub 'Pull requests' tab

  4. On the GitHub page Comparing changes, use the dropdowns to configure the PR branches as follows:

    • For base, choose the branch you want to merge into (for example, master).
    • For compare, select the branch you’re merging from (for example, your branch).

    For example, in the following image, the PR is configured to merge the branch update-repo-structure into the master branch.

    Example branch configuration on the GitHub 'Comparing changes' page

  5. Select Create pull request.

    'Create pull request' button on the GitHub 'Comparing changes' page

  6. On the GitHub page Open a pull request, add the following into the PR title text entry field:

    • number of the module that the file you’re merging belongs to
    • type of action you performed on the file you’re merging (for example, content edit review, image updates)
    • name of the (base) branch you’re merging into (for example, master)

    For example, in the following image, a suitable PR title is Mod 6 - Add file & folder structure - Merge into master.

    Example PR title on the GitHub 'Open a pull request' page

  7. Optional: On the GitHub page Open a pull request, in the Write tab, add an extended description of the additions/ changes you made to the file you’re merging.

    For example, in the following image, a suitable extended description is Add directories containing placeholder markdown files, to create the file and folder structure for Module 06 on GitHub.

    Example extended description in the 'Write' tab on the GitHub 'Open a pull request' page

    Note: Extended descriptions provide a way for contributors to explain the changes they applied to files on GitHub. Extended descriptions are optional, but recommended.

    The reviewer’s guides in the Workflow and processes section of this website suggest adding a checklist of items the for review into the Write tab. A checklist provides a convenient way for reviewers, content authors, and other contributors to track the progress of a review. To add a review checklist into the Write tab on GitHub, choose a guide that corresponds to your role from the navigation menu on the left of this website.

  8. From the right side menu on the GitHub page Open a pull request, in the Reviewers section, select the gear icon. In the text entry field, enter the GitHub username of the person you want to review your file. Then, choose the reviewer’s GitHub username from the list of suggestions to add them as a reviewer to the PR.

    The following image shows adding the GitHub user eamonnk to the PR.

    GitHub username in the 'add reviewer' field on the GitHub 'Open a pull request' page

    The following image shows the GitHub user eamonnk added as a reviewer to the PR.

    GitHub user added as a reviewer on the GitHub 'Open a pull request' page

    Note: When you add a GitHub user as a reviewer to the PR, like an ID reviewer, GitHub will send the reviewer a notification each time a change is made to the pull request (for example, when a file in the PR is edited).

    Depending on the branch policies that apply to the project you’re working on, you might be required to add a reviewer when you create a new PR. Ask your project manager about the branch policies that apply to the particular project you’re working on.

  9. On the GitHub page Open a pull request, choose Create pull request.

    Create pull request button on the GitHub 'Open a pull request' page

    Note: Keep the new PR open (i.e. do not merge the PR yet). Keeping the PR open allows you to apply and push subsequent changes from your local branch “up” to GitHub. Any further changes that you push from your local branch up to GitHub will be “rolled into” your open pull request.

    At this stage, the reviewer evaluates the file that contains your additions/ changes.

    Where necessary, the reviewer will add comments about your changes to the open PR, or by sending you an email. Adding comments to a GitHub PR is useful for discussing changes, sharing suggestions, and consulting the reviewer about the changes you made to the file on your branch. To evaluate a reviewer’s feedback in a PR, follow the guide Work in a pull request.

You have created a pull request on GitHub successfully.

Appendices

Check the following supplementary Appendices for more details and context.