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 issuelabel
Read CONTRIBUTING.md if present—follow fork/branch rules.
Fork on GitHub
- Open upstream repo (e.g.
upstream-org/some-project) - Click Fork → creates
YOUR_USER/some-project - Clone your fork, not upstream:
git clone git@github.com:YOUR_USER/some-project.git
cd some-project
git remote -vAdd upstream remote:
git remote add upstream git@github.com:UPSTREAM_ORG/some-project.git
git remote -vCode explanation:
origin= your fork (push here)upstream= original (fetch updates, never push unless maintainer)
Create Fix Branch
Sync default branch:
git switch main
git pull upstream main
git push origin mainBranch:
git switch -c fix/readme-typoEdit—example:
# Fix spelling in README.md
git add README.md
git commit -m "docs: fix typo in installation section"
git push -u origin fix/readme-typoOpen 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:
## Summary
Fixes spelling mistake in README installation steps.
## Test plan
- [ ] Read corrected paragraph for clarityLink issue if exists: Fixes #42.
Respond to Review
Maintainer may request tweaks:
git add README.md
git commit -m "docs: address review wording"
git pushPR updates automatically.
Sync Fork After Upstream Moves
Other merges land on upstream while your fork ages:
git fetch upstream
git switch main
git merge upstream/main
git push origin mainOr 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
-
upstreamremote 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.