The Open-Source Fork Workflow
Contributing to open-source via forks: forking on GitHub, configuring upstream remotes, syncing main, and opening cross-repo pull requests.
The Open-Source Fork Workflow
When contributing to open-source repositories where you do not have direct push access, the standard model is the Fork Workflow.
1. Step-by-Step Fork Contribution Workflow
[ Upstream Repo (iamtashanto/OpenDevDocs) ]
│ (Fork on GitHub)
▼
[ Your Remote Fork (yourname/OpenDevDocs) ]
│ (git clone)
▼
[ Your Local Machine (Working Tree) ]Step 1: Fork on GitHub
Navigate to the target repository (e.g. github.com/iamtashanto/OpenDevDocs) and click the Fork button in the top right.
Step 2: Clone Your Fork Locally
git clone git@github.com:yourname/OpenDevDocs.git
cd OpenDevDocsStep 3: Add the Upstream Remote
Configure a connection to the original parent repository so you can pull future updates:
git remote add upstream https://github.com/iamtashanto/OpenDevDocs.git
# Verify remotes:
git remote -v
# origin git@github.com:yourname/OpenDevDocs.git (push/fetch)
# upstream https://github.com/iamtashanto/OpenDevDocs.git (fetch)Step 4: Keep Your Fork Synced with Upstream
Before starting new work, pull the latest changes from the upstream main branch:
git switch main
git pull --rebase upstream main
git push origin mainStep 5: Create a Branch, Commit, and Open PR
git switch -c docs/add-css-grid
# ... edit markdown files ...
git add .
git commit -m "docs: add comprehensive CSS grid guide"
git push -u origin docs/add-css-gridGo to GitHub to open a Pull Request from yourname/OpenDevDocs:docs/add-css-grid to iamtashanto/OpenDevDocs:main.
Related Topics
GitHub Pull Requests (PRs)
The complete Pull Request workflow: branch creation, commits, opening PRs, review requests, draft PRs, and merge strategies.
Effective Code Reviews on GitHub
Conducting constructive code reviews: inline diff comments, suggestion blocks, review states (Approve, Request Changes), and review etiquette.