Skip to content
BENIBIX Learn

Git Clone

Development🔀 Version ControlRemotes

Also known as Clone a Repository, Clone

Your own full copy of a repo, with all of its past.

Think of it like

Think of it like a copy of a whole book, notes and all. Now you have your own to read.

Example

Jack joins Emma's team. He clones the shop repo and has the full project, history included, in a few seconds.

Why it matters

Cloning is how anyone starts work on a shared project. Every clone is also a full backup.

Definition

To clone is to copy a whole repo from a remote onto your computer. You get every file and the whole history, not just the latest version. Git also notes where the copy came from, as a remote named origin. Then you can work, commit and later push back. It is often the first thing you run when you join a team.

Example code

console
$ git clone https://example.com/ada/shop.git
Cloning into 'shop'...
done.
A new folder called shop now holds the whole project.

Common mistake

Downloading the code as a zip instead. A zip has no history and cannot push changes back.

Key takeaways

  1. 1
    Full copy. Every file and every commit.
  2. 2
    Knows its source. The remote is saved as origin.
  3. 3
    First step. How you join a project.

Compare

Learn it properly