DaleSchool

Contributing to Open Source with Forks

Beginner20min

Learning Objectives

  • Explain the difference between Fork and Clone
  • Make changes in a forked repository and send a PR to the original
  • Understand the open-source contribution workflow

What Is a Fork?

A fork copies someone else's repository into your own account.

You cannot directly edit the original repository. But once you fork it, you get your own copy where you can make changes freely. When you are done, you send a Pull Request back to the original.

Original repo                 Your Fork
(someone else's account)      (your account)
       |                           |
       └──── Fork ────────────────>|
                                   | edit
                                   |
       <──── Pull Request ─────────┘

This is the basic flow of open-source contribution.

Forking a Repository

  1. Go to the repository you want to contribute to
  2. Click the Fork button in the top-right
  3. Click Create fork

You now have a copy at github.com/youraccount/reponame.

Working on Your Fork

Create a branch in your fork and make edits.

  1. In the forked repository, create a new branch: fix-typo
  2. Find the file to edit (e.g., fix a typo in README.md)
  3. Edit the file and commit

Important: Always work on a branch. Editing your fork's main directly makes syncing with the original more complicated later.

Sending a PR to the Original Repository

  1. Go to your forked repository page
  2. Click ContributeOpen pull request
  3. Write a PR title and description

A good open-source PR description:

Title: fix: correct typo in README install command

Body:
## Changes
Fixed `npm insatll` → `npm install` typo

## Motivation
Found the typo while following the installation guide.
  1. Click Create pull request

The original repository's maintainer will review and decide whether to merge.

Open-Source Contribution Etiquette

Follow the project's rules to make your contributions welcome.

Before contributing:

  • Read CONTRIBUTING.md if it exists
  • Check if the same Issue/PR already exists
  • For large changes, propose via an Issue first and get feedback

When writing the PR:

  • Keep it small (avoid too many changes in one PR)
  • Explain why the change is needed
  • Follow the project's code style

When receiving review feedback:

  • Change requests are not criticism — they are helping improve your contribution
  • Share your reasoning politely if you disagree
  • Address actionable feedback promptly

"Why?" — What Open-Source Contribution Gives You

Contributing to open source is more than fixing code.

Skill growth: You read and modify code in real projects used by thousands. You learn things textbooks cannot teach.

Resume builder: "React contributor" is a powerful credential. Your name appears in the commits at github.com/facebook/react.

Networking: You collaborate with developers worldwide. Many people have landed jobs through open-source connections.

Start small — fix a typo, improve documentation. The experience of contributing is what matters.

Deep Dive

Keeping Your Fork Up to Date

When the original repository gets new commits, your fork falls behind. Here is how to sync:

On your fork's page, click Sync forkUpdate branch.

The original's latest changes are now in your fork. Always sync before sending a PR.

Finding Good Projects for Your First Contribution

If you want to make your first open-source contribution:

Translating documentation is also a great entry point.

  1. Fork any public repository on GitHub (e.g., a beginner practice repository).
  2. Create a new branch in the forked repository and edit one file.
  3. Open a Pull Request to the original repository (it does not need to actually be merged).

Q1. What correctly describes the difference between Fork and Branch?

  • A) Fork copies within the same repository, and Branch copies to a different account
  • B) Fork copies a repository to a different account, and Branch separates work streams within the same repository
  • C) Fork and Branch are the same feature
  • D) Fork deletes files, and Branch adds files

Further Reading