Lesson 5 / 28

git clone

Copy an existing repository with git clone, including every commit, branch and tag.

By · 15 years in web development · Updated 1 Oct 2026

Clone a remote repo

This downloads every commit, branch and tag — not just the current files.

git clone https://github.com/octocat/hello-world.git
cd hello-world

Output:

Cloning into 'hello-world'...
remote: Enumerating objects: 42, done.

Custom folder name

Add a second argument to clone into a differently named folder: git clone <url> my-folder.