What is a fork in GitHub?

Why Interviewers Ask This

Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Git & GitHub development. It reveals whether you understand the building blocks that more complex concepts rely on.

Answer

A fork is a personal copy of someone else's repository on GitHub (or GitLab). Forking creates an independent copy under your GitHub account — you can modify it freely without affecting the original (upstream) repository. Forks are the foundation of open-source contribution: (1) You find a project you want to contribute to; (2) Fork it to your account; (3) Clone your fork locally; (4) Create a branch and make changes; (5) Push to your fork; (6) Open a pull request from your fork to the upstream repository. Fork vs Branch: a fork is a server-side copy (different GitHub account/organization); a branch is within the same repository. Staying in sync with upstream: git remote add upstream https://github.com/original/repo.git; git fetch upstream; git merge upstream/main or git rebase upstream/main. When to fork vs branch: fork when you don't have write access to the original repo (open-source contributions); branch when you're working within your own or your team's repo. Forks maintain a connection to the upstream repository, enabling pull requests back to the original.

Pro Tip

If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.