Episode 12 of 12

Forking and Contributing

Learn how to fork repos and contribute to open-source projects on GitHub.

Forking is how you contribute to projects you don't have write access to — especially open-source projects.

What is a Fork?

A fork is a personal copy of someone else's repository on your GitHub account. You can make changes freely without affecting the original project.

The Forking Workflow

  1. Fork the repository on GitHub (click the "Fork" button)
  2. Clone your fork to your local machine
  3. Create a new branch for your changes
  4. Make changes and commit
  5. Push to your fork on GitHub
  6. Create a Pull Request to the original repository

Step-by-Step

# 1. Fork on GitHub (click the Fork button)

# 2. Clone YOUR fork
git clone https://github.com/YOUR-USERNAME/repo.git
cd repo

# 3. Add the original repo as "upstream"
git remote add upstream https://github.com/ORIGINAL-OWNER/repo.git

# 4. Create a branch
git switch -c fix/typo-in-readme

# 5. Make changes and commit
git add .
git commit -m "Fix typo in README"

# 6. Push to YOUR fork
git push origin fix/typo-in-readme

# 7. Go to GitHub and create a Pull Request

Keeping Your Fork Up to Date

# Fetch latest from the original repo
git fetch upstream

# Merge into your main branch
git switch main
git merge upstream/main

# Push the updates to your fork
git push origin main

Contributing Tips

  • Read the project's CONTRIBUTING.md guide
  • Check existing issues for things to work on
  • Start with small contributions — typo fixes, documentation improvements
  • Write clear PR descriptions explaining what you changed and why
  • Respond politely to code review feedback
  • Follow the project's coding style and conventions

Congratulations! You've completed the Git & GitHub tutorial series. You now have the skills to manage code with Git and collaborate with developers worldwide on GitHub! 🎉