Skip to content

Assignments via GitHub

Course assignments and student workbooks are often distributed as git repositories via GitHub. You can accept invitations to any of these by going to your Organization Settings on GitHub.

When your instructor hands out an assignment (or posts a fix or some starter code), the changes usually arrive as a pull request on your repository. A pull request is just a request to add one set of changes into your main branch. Nothing is added to your project until you merge it.

Here is how to merge a pull request on GitHub.

  1. Open your assignment repository on GitHub.

  2. Click the Pull requests tab near the top of the repository. The number beside it tells you how many pull requests are waiting for you.

    The Pull requests tab in the GitHub repository menu, with a badge showing one open pull request
  3. In the list, click the title of the pull request you want to accept (for example, Assignment 1).

    The list of open pull requests, showing one titled Assignment 1
  4. Near the top of the pull request you should see a green Ready to merge message. This means GitHub can add the changes automatically.

    The Ready to merge status shown at the top of the pull request page
  5. Scroll to the bottom of the Conversation tab. When you see “No conflicts with base branch”, click the green Merge pull request button.

    The Merge pull request button below a No conflicts with base branch message
  6. GitHub shows a commit message. Leave it as it is and click Confirm merge.

    The Confirm merge button below the pre-filled commit message and extended description
  7. The pull request now shows a purple Merged badge. The changes are now part of your main branch on GitHub.

    The pull request header showing a purple Merged badge
  8. Switch to the copy of the repository on your computer and run git pull so your local files match GitHub.

    Terminal window
    git pull