Session 3 — Exercises: Fork, Pull Request, and Issues
Last updated on 2026-03-03 | Edit this page
Overview
In this session you will learn to contribute to a repository you do not own by forking it, and you will practise using GitHub Issues.
Time frame: approximately 75 minutes of hands-on work.
Pair setup: work in the same pairs as Session 2. This time you will contribute to your partner’s repository without being a collaborator.
Task 1: Fork Workflow
Level 1 — Fork your partner’s repository
- Go to your partner’s repository on GitHub (the one from previous sessions).
- Click the Fork button in the top-right corner.
- Keep the default settings and click Create fork.
- Clone your fork (not the original) in GitHub Desktop.
Checkpoint 1
You now have a copy of your partner’s repository under your own GitHub account. GitHub Desktop shows the fork as your current repository.
Task 2: Pull Request to Upstream
Level 1 — Open a PR against the original repository
- On GitHub, navigate to your fork.
- Click Contribute → Open pull request.
- Make sure the base repository is your partner’s
repo and the base branch is
main. - Fill in a descriptive title and description explaining your changes.
- Click Create pull request.
Checkpoint 2
Your partner can see the pull request on their repository. The PR shows your changes and allows them to review and comment.
Partner's repo (upstream) Your fork (origin) Your computer (local)
│ │ │
│ fork │ │
│◄─────────────────────────│ │
│ │ clone │
│ │◄─────────────────────────│
│ │ │
│ │ edit + commit + push │
│ │◄─────────────────────────│
│ pull request │ │
│◄─────────────────────────│ │
Task 3: GitHub Issues
Level 1 — Create an issue
- On your own repository, go to the Issues tab.
- Click New issue.
- Write a clear title (e.g. “Add a licence file”).
- In the description, explain what needs to be done and why.
- Submit the issue.
Checkpoint 3
Your issue is visible in the Issues tab with a unique number (e.g. #1).
Level 2 — Labels and linking
- Add a label to your issue (e.g.
enhancementordocumentation). If no labels exist yet, create one. - Create a new branch, make the change described in the issue, and open a PR.
- In the PR description, write
Closes #1(replacing1with your issue number) to link the PR to the issue.
When you include Closes #1, Fixes #1, or
Resolves #1 in a PR description, GitHub will
automatically close the linked issue when the PR is
merged.
Level 3 — Issue templates and advanced features
- Explore the Labels page and create a few custom
labels for your repository (e.g.
help wanted,good first issue). - Write a second issue with a detailed bug report format:
- Steps to reproduce
- Expected behaviour
- Actual behaviour
- Cross-reference the two issues by mentioning one in the other (e.g. “Related to #1”).
Summary
By the end of this session you should have: