How to Download From GitHub on Windows, Linux & Mac OS X

How to Download From GitHub on Windows, Linux & Mac OS X

GitHub is a wonderful resource for developers although it can seem a little complicated to use at first. In this tutorial, we'll show you how to download from GitHub on the following operating systems:

  1. MS Windows & Mac OS X
  2. Linux (CentOS, Debian and Ubuntu)

So without further ado, let's start.

How to Download From GitHub on Windows & Mac OS X

Mac and Windows users will be happy to find out that files and projects can be download from GitHub by using a GUI. There are actually many Git clients available, some free and some commercials, but for this tutorial, we'll stick to the official Git clients from GitHub.

  1. Head over to https://desktop.github.com/ and download the Native Git Desktop for your operating system.
  2. Once the download has completed, proceed with the installation. When asked to sign in, you can either create a free account or skip this step.

    GitHub Desktop for Windows - Setup
  3. Once you've completed the installation, you will see the GitHub Desktop window. Click on Clone a repository:

    Clone GitHub Repository

  4. Now you'll need to get the URL of the project you wish to download from GitHub. For this tutorial, we'll download phpMyAdmin. The URL for the project is https://github.com/phpmyadmin/phpmyadmin. It's basically the same URL you would  use to access the phpMyAdmin project from your web browser. Select the URL tab and copy the project URL in the text box:

    Clone Project From URL

  5. If you wish to modify the local path, choose another folder. When you're done, click the Clone button. The phpMyAdmin project will be downloaded to your hard drive.

    GitHub Desktop - Cloning phpMyAdmin

  6. Once the cloning process has completed, simply click on "open this repository in Explorer" to access the phpMyAdmin files:

    GitHub Desktop - Open Repository in Explorer

So that's basically all there is to it. Next, you can copy the downloaded files to your project.

How to Download From GitHub on Linux

On Linux, you'll to install "Git". Here's how to do this depending on the Linux distribution you are using:

Installing Git on CentOS

sudo yum install git

Installing Git on Debian

sudo apt-get install git-core

Installing Git on Ubuntu

sudo apt-get install git

Once you've installed Git, you can check its version:

git --version 

Configuring Git for Linux

In order to use Git, you'll need to specify your name and email address:

git config --global user.name "John Doe"
git config -- global user.email "johndoe@email.com"

Cloning a GitHub Repository

Start by creating a directory in which you will keep all the GitHub repositories you'll clone:

mkdir ~/git
cd ~/git

Before you can clone a repository, you need to find the URL to its ".git" file. For this example, we're going to clone the phpMyAdmin repository. Open this URL in your browser: https://github.com/phpmyadmin/phpmyadmin

GitHub Clone or Download Button

Click on the green "Clone or download" button and then on the "Copy to clipboard" icon next to the URL.

Now use this URL with the "git" command to clone the repository:

git clone https://github.com/phpmyadmin/phpmyadmin.git

Once the download is completed, the phpMyAdmin files will be found in ~/git/phpmyadmin

So, downloading files from GitHub is as simple as that. Of course, there is much more you can do with Git, such as managing your own repositories or contributing to other projects. If you're interested in learning more about Git, you can read the official documentation here.

Is Your Website Slow?

A slow website can cost you visitors. Enter your website URL below to test its load speed now and find out how to make it faster:

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclosure: We receive a compensation from some of the companies whose products are presented on our website.