8.6. Forks, Templates, and Discoverable Repositories
Three different tools support the same underlying goal — helping people build on existing work — but each does it differently, and mixing them up is a well-worn exam trap.
💡 First Principle: A fork creates a copy of a repository under your own account while staying connected to the original (the "upstream" repository), designed specifically for proposing changes back via a pull request. A template repository (3.2) creates a fresh, disconnected copy meant to start something new. Discoverability — driven by topics (tags a repository owner applies) and search — is what lets people find relevant public repositories in the first place, whether to fork, use as a template, or simply reference.
| Fork | Template | Topics/Discovery | |
|---|---|---|---|
| Connected to source? | Yes (upstream) | No | N/A |
| Typical goal | Contribute changes back | Start something new | Find relevant repositories |
| Fresh commit history? | No — shares history | Yes | N/A |
⚠️ Exam Trap: A fork stays connected to its upstream repository (enabling pull requests back to the source); a repository created from a template does not — see 3.2 for the full contrast between the two.
Reflection Question: A developer wants to fix a bug in an open-source library they don't maintain and submit the fix back to the original project. Should they fork it or create a repository from its template, and why does the difference matter here?