Fundamentals

Clone

Cloning copies a repository — its files and its history — from a service such as GitHub onto your own machine so you can start working with it.

What cloning does

Cloning copies a remote repository to your computer, creating a local repository. It brings down not only the current files but, normally, the commit history and the information needed to work with branches.

When you first want to edit a GitHub project locally, you use git clone or the Clone command in GitHub Desktop. Inside the resulting folder you can then edit, commit, pull, and push.

What gets configured

Git records where you cloned from as a remote, conventionally named origin. That is what lets you later run git pull to bring in changes, or git push to send yours if you have write access.

How it differs from downloading

GitHub’s Download ZIP gives you the files as they are right now. A clone also carries the history and the remote configuration, which is what you want if you intend to keep following the project.

If you only want to read the code, a ZIP is enough. If you want to edit while pulling in updates, cloning is easier to live with.

Usually a one-time step

You do not re-clone every time you sit down to work. Open the folder you cloned before and pull the latest changes.

Cloning repeatedly into the same location leaves you with several copies and no clear sense of which one is current.

Cloning a private repository requires read access and authentication. GitHub supports HTTPS and SSH, using an access token or an SSH key in place of a password. A correct URL still fails without permission, so when you hit an error, check the address and the authentication method separately.

It is also worth checking you have the disk space before you start.

Related terms

Sources and review information

Last reviewed July 21, 2026

Back to the AI Glossary

Search this site