Article version:

Cloning a repository

When you create a repository on GitHub, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.

In this article

This procedure assumes you have already created a repository on GitHub, or have an existing repository owned by someone else you'd like to contribute to.

Cloning a repository using the command line

  1. On GitHub, navigate to the main page of the repository.

    Note: If the repository is empty, you can manually copy the repository page's URL from your browser and skip to step four.

  2. Under the repository name, click Clone or download.

    Clone or download button

  3. To clone the repository using HTTPS, under "Clone with HTTPS", click . To clone the repository using an SSH key, including a certificate issued by your organization's SSH certificate authority, click Use SSH, then click .

    Clone URL button

  4. Open TerminalTerminalGit Bash.

  5. Change the current working directory to the location where you want the cloned directory to be made.

  6. Type git clone, and then paste the URL you copied in Step 2.

    $ git clone
  7. Press Enter. Your local clone will be created.

    $ git clone
    > Cloning into `Spoon-Knife`...
    > remote: Counting objects: 10, done.
    > remote: Compressing objects: 100% (8/8), done.
    > remove: Total 10 (delta 1), reused 10 (delta 1)
    > Unpacking objects: 100% (10/10), done.

Cloning a repository to GitHub Desktop

  1. On GitHub, navigate to the main page of the repository.
  2. Under your repository name, click to clone your repository in Desktop. Follow the prompts in GitHub Desktop to complete the clone. For more information, see "Cloning a repository from GitHub to GitHub Desktop."

Further reading

Ask a human

Can't find what you're looking for?

Contact us