Fork vs clone vs template vs branch
Verdict: Fork to contribute to a repo you do not maintain: only a fork's changes merge back upstream via a pull request. Clone is local, a template starts independent, and a branch stays inside the repo.
| Criterion | Fork | Clone | Template | Branch |
|---|---|---|---|---|
| What it makes | A new repository in your account linked to the original | A local copy on your machine | A new independent project seeded from a repo | Another line of development inside the same repo |
| Merge back upstream via PR | Yes | No | No, it starts independent | Stays inside the original repo |
| Use when | Contribute to a project you do not maintain | Work on files locally | Start a new project from a starting point | Isolate work in a repo you can write to |
Rules
- A fork is a new repository that shares code with the original; only a fork's changes can be merged back upstream through a pull request.
- An external contributor forks a public repo to their account, makes the change, then opens a pull request to the original.
- Regular collaborators with write access should work from the shared repository and open pull requests between branches, not fork.
Traps
- Cloned or template-created repositories cannot have their changes merged back upstream via a pull request the way a fork can.
- A new branch stays inside the original repository; it is not a separate independent copy.