CodeBlanks Logo Icon CodeBlanks

Fork vs clone

Learn the difference between fork and clone.

Fork vs Clone

A fork creates a new copy under your account on the remote hosting service. Clone downloads a repository from a remote server to your computer. They are different operations and are often used together in open-source contribution workflows.

Fork: Account copy on the server
Clone: Working copy on your computer

Use Both Operations Together

In an open-source contribution workflow, you can first fork a project into your account and then clone your fork to your computer. This keeps the remote account copy separate from your local working directory.

1. Fork: copy to your account
2. Clone: download to your computer
3. Edit and create commits

Practice Clone a Fork Repository

Write the correct Git command to download the sample-app repository from the dev-user account to your computer.

Starter code

terminal
# Fork deposunu yerel bilgisayara indir

Expected output

Cloning into 'sample-app'...

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What is the main difference between fork and clone?

  • Clone automatically deletes the original repository.
  • Fork copies to a computer, clone copies to an account.
  • Both only change the commit message.
  • Fork creates an account copy on the server, while clone downloads to a computer. Correct answer

Explanation: Fork creates a copy in your hosting account; clone downloads the repository to your local computer.

2 Download the Fork to Your Computer

Question
git clone ____
Answer
git clone https://github.com/dev-user/sample-app.git

Explanation: The git clone command is used to clone a repository. The repository URL follows the command.

3 Fork and Clone Comparison

Term Meaning
Fork Creates a new repo in remote account
Clone Downloads repo to a local computer
Fork adresi Repository in user's own account
Yerel kopya The working directory on the computer

All lessons in Intermediate

20 Intermediate final

  1. Branch management
  2. Rebase
  3. Conflict
  4. PR flow