How to Checkout/Download code from GitHub?

To work with code from the Github, first install git in your machine. After installation, go to GitHub. Search for the code you are looking to download.

Every project has an associated Git associated link.

Let’s take the example of Mozilla Chromeless. The project codebase is available at

http://github.com/mozilla/chromeless

The associated git link is

http://github.com/mozilla/chromeless.git

To download the code,

$ git clone http://github.com/mozilla/chromeless.git
Initialized empty Git repository in /home/user/experiments/git/chromeless/.git/
remote: Counting objects: 6865, done.
remote: Compressing objects: 100% (4446/4446), done.
remote: Total 6865 (delta 2272), reused 6435 (delta 2063)
Receiving objects: 100% (6865/6865), 2.46 MiB | 29 KiB/s, done.
Resolving deltas: 100% (2272/2272), done.

Now list the directory contents

$ ls
chromeless
$ ls chromeless/
impl  README.md  run  template  ui

Let’s check all the contents. You can see some hidden files

$ ls -a chromeless/
.  ..  .git  .gitignore  impl  README.md  run  template  ui
Advertisements