Project: Fork Open Source and Contribute

Introduction

Open source contribution starts with a fork: your copy on GitHub, changes on a branch, Pull Request to the upstream original repo. This project fixes a small doc typo or adds a clarifying sentence—skills that transfer to any library you use daily.

Prerequisites

Choose a Target

Pick a repo you may contribute to:

  • Small doc typo in a tutorial project
  • hello_code itself (if you run this site locally)
  • Any repo with good first issue label

Read CONTRIBUTING.md if present—follow fork/branch rules.

Fork on GitHub

  1. Open upstream repo (e.g. upstream-org/some-project)
  2. Click Fork → creates YOUR_USER/some-project
  3. Clone your fork, not upstream:
bash
git clone git@github.com:YOUR_USER/some-project.git
cd some-project
git remote -v

Add upstream remote:

bash
git remote add upstream git@github.com:UPSTREAM_ORG/some-project.git
git remote -v

Code explanation:

  • origin = your fork (push here)
  • upstream = original (fetch updates, never push unless maintainer)

Create Fix Branch

Sync default branch:

bash
git switch main
git pull upstream main
git push origin main

Branch:

bash
git switch -c fix/readme-typo

Edit—example:

bash
# Fix spelling in README.md
git add README.md
git commit -m "docs: fix typo in installation section"
git push -u origin fix/readme-typo

Open PR to Upstream

On GitHub, open PR from YOUR_USER/some-project branch to UPSTREAM_ORG/some-project main.

Title: docs: fix typo in installation section

Body:

markdown
## Summary
Fixes spelling mistake in README installation steps.
 
## Test plan
- [ ] Read corrected paragraph for clarity

Link issue if exists: Fixes #42.

Respond to Review

Maintainer may request tweaks:

bash
git add README.md
git commit -m "docs: address review wording"
git push

PR updates automatically.

Sync Fork After Upstream Moves

Other merges land on upstream while your fork ages:

bash
git fetch upstream
git switch main
git merge upstream/main
git push origin main

Or rebase feature branch onto latest upstream before new work.

Etiquette

  • One logical change per PR
  • Be polite in comments
  • Do not @ maintainers repeatedly
  • Accept closure if out of scope—learn and move on

Checklist

  • Fork under your account
  • upstream remote configured
  • PR opened against original repo, not your fork's main only
  • Commit message follows project conventions

FAQ

PR from wrong repo?

Base must be upstream; compare is your fork branch.

Permission denied push upstream?

Always push to origin (fork); maintainers merge upstream.

Fork behind upstream?

Fetch and merge upstream/main before new branches.

Large drive-by refactor rejected?

Start with tiny doc fix; build trust.

Signed commits required?

Some projects need GPG—check CONTRIBUTING.

Abandoned fork?

Delete on GitHub; re-fork fresh if needed.