Welcome to GitHub How-To’s documentation!

Download files from a GitHub repository

There are different ways to get a copy of a repository’s files on GitHub. You can:

  • Download a snapshot of a repository’s files as a zip file to your own (local) computer.

  • Clone a repository to your local computer using Git.

  • Fork a repository to create a new repository on GitHub.

  • Browse the repository’s directories and download only specific files.

From the GitHub Documentation : Downloading files from GitHub.

Download the repository

This is the easiest way to obtain the most up-to-date source code.

To download a repository, you need to follow these steps:

  1. Navigate to the main page of the repository you want to clone.

  2. Above the list of files, click <> Code.

    _images/git_hub_code_icon.png
  3. Click Download ZIP

    _images/git_hub_download.png
  4. Change the current working directory to the location where you want to download the repository ZIP file.

  5. Go into your file browser and go to the selected directory for this repository.

  6. Unzip the archive file.

Clone the repository

This is the best way to obtain the most up-to-date source code. However, you need to be familiar with the use of Git and a client software able to manage git repository must be installed (such as Git Bash or GitHub Desktop…).

To clone a repository, you need to follow these steps:

  1. Navigate to the main page of the repository you want to clone.

  2. Above the list of files, click <> Code.

    _images/git_hub_code_icon.png
  3. Copy the URL for the repository in the corresponding HTTPS Clone sub-section.

    _images/git_hub_https_clone.png
  4. Open Git Bash (or another git management software).

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

  6. Type git clone, and then paste the URL you copied earlier.

    git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
    
  7. Press Enter to create your local clone.

  8. Go into your file browser and go to the selected directory for this repository.

From the GitHub Documentation : Cloning a repository.

Download specific files

The most boring way to obtain files in a GitHub repository is to browse in the different directories and to manually download each file you need.

To download specific files from a repository, you need to follow these steps:

  1. Navigate to the main page of the repository you want to clone.

  2. Browse through the different directories.

    _images/git_hub_browse.png
  3. Open a file and click Download raw file icon.

    _images/git_hub_raw_download.png
  4. Change the current working directory to the location where you want to download the raw file.