Interview Q&A / Git & GitHub

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between a fork, a clone and a branch?

SHORT ANSWER

A fork is your own server-side copy of someone else's GitHub repository. A clone is a local copy on your computer. A branch is a separate line of work inside one repository.

Explain it simply

Picture a famous cookbook. A fork is buying your own copy of the whole book and keeping it in your own shelf on GitHub, so you can scribble without permission. A clone is carrying that book home. A branch is a loose page inside one book where you try a new recipe.

You fork when you cannot write to the original project, then clone your fork, work on a branch, push, and open a pull request back to the original. Inside a team repo where you have write access, you usually just clone and branch.

Example

text
original/repo  --fork-->  you/repo  --clone-->  laptop
                                         |
                                  git switch -c feature  (branch)

What to say in the interview

"A fork is a GitHub-side copy owned by me, a clone is a local copy of a repository, and a branch is a line of development inside one repository. For open source I fork, clone my fork, branch, and open a pull request to the original."

#github#fork#clone

Related questions

Practise more Git & GitHub questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Git & GitHub quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.