How to Clone/Download A Github Repositories

Github has one of the largest collection of repostings in the world. From small websites to big complex software, everything is here. To get the code on your local there is no direct method you have to clone the repository to your local machine. There are 2 ways how you could do this first one is using Command-line and the other one is using the command-line. For beginners, I would suggest you use Github Desktop as this method is simple to use and you won’t get stuck in it.

Using Command-line

To clone a repository using Command-Line you have to first install git version control then only you will be able to clone the repo.

  1. On Github, navigate to the repository page which you want to clone/download.
  2. Above the list of files, you will see a green button click  Code.
"Code" button
  1. To clone the repository using HTTPS, under “Clone with HTTPS”, click. To clone/download the repository using an SSH key, including a certificate issued by your organization’s SSH certificate authority, click Use SSH, then click. To clone a repository using GitHub CLI, click Use GitHub CLI, then click .
The clipboard icon for copying the URL to clone a repository
  1. Open Terminal
  2. Change the current working directory to the location where you want the cloned directory.
  3. Type git clone, and then paste the URL you copied earlier.
$ git clone

7. Press Enter to create your local clone.

$ 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.

Method 2 – Using GitHub Desktop

  1. Go to, navigate to the main page of the repository.
  2. Above all the code you will find a Code button in green colour click it to open a small tab.
"Code" button
  1. Click on GitHub desktop to clone and open the repository with GitHub Desktop.
"Open with GitHub Desktop" button
  1. Follow the prompts in GitHub Desktop to complete the clone.


With this, you will have a folder created on your local machine with git initiated in it. Now any changes that you make in that folder can be committed easily to GitHub again.

In this document we took a deep look at git clone. The most important takeaways are:

1. git clone is used to create a copy of a target repo

2. The target repo can be local or remote

3. Git supports a few network protocols to connect to remote repos

4. There are many different configuration options available that change the content of the clone

If you face any problem with the above steps, just comment below.