Forking a Repository
A fork is your own GitHub copy of someone else's repository. Forking lets you freely experiment and make changes, then propose those changes back to the original via a Pull Request — the foundation of all open source contribution on GitHub.
01.Fork vs Clone: Know the Difference
Clone creates a local copy on your machine. Fork creates a copy on GitHub under your account. For repos you own or are a collaborator on: clone directly and push branches. For repos you have no write access to (most open source): fork first to get your own copy on GitHub, then clone your fork, make changes, and open a PR to the original.
02.The Complete Fork Contribution Workflow
Step 1: Click "Fork" on GitHub — creates a copy at YOUR_USERNAME/repo. Step 2: Clone YOUR fork to your machine. Step 3: Add the original as "upstream" remote. Step 4: Create a descriptive branch. Step 5: Make your changes and commit. Step 6: Push your branch to your fork (origin). Step 7: Click "Compare & pull request" on GitHub to propose the change.
Commands
When should you fork instead of just cloning?