Version Control

fork

A fork is your own complete copy of someone else's repository, made on the hosting side (GitHub, GitLab) with a single click. It lives under your account, so you can change anything you like without needing permission to touch the original.

It's how open source works: you fork a project you can't write to, push your changes to your copy, and then open a pull request asking the original maintainers to pull your work back in. They review it; if they like it, it becomes part of the real project.

Don't confuse a fork with a clone or a branch. A branch is a line of work inside one repo; a clone is a copy on your own laptop; a fork is a whole separate repo on the server, with your name on it — your launchpad for proposing changes to a project that isn't yours.

$ gh repo fork octocat/Hello-World --clone
✓ Created fork yourname/Hello-World
✓ Cloned fork to ./Hello-World

Fork a repo to your account and clone it locally — one command, then you're free to change it.

The word predates GitHub: in Unix, to fork a process means to split off a new copy that runs on its own. Same idea — one thing becomes two independent lines.

Also called
fork a repoforkingserver-side copy