Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to clone a repository. The command is:

git clone https://github.com/androportal/linux-sunxi.git

If I do it this way it takes a long time to install/download. Now I opened this link and I got a zip file of the same linux-sunxi. How do I install this zip file? I mean what is difference between cloning and a zip file?

share|improve this question
    
There are full install instruction provided in the repository... github.com/androportal/linux-sunxi/blob/sunxi-3.0/README.rst –  panmari Jan 6 '13 at 15:41
add comment

1 Answer

If git clone ... takes too long and you just want to checkout one revision (i.e. you don't want all the history) of the repository, do this:

git clone --depth 1 protocol://path/to/repo

As from this answer on StackOverflow. This gets you the latest commit, without history. It's still gonna take you a long time, as it appears to be the whole Linux kernel...

A regular clone is a repository with all its history and commit messages. The ZIP-file just contains the state of the repository at a single commit (snapshot) without any history. This --depth option provides you a way to do this with Git without the need for a ZIP file for every commit.

About the ZIP-files on Github in particular. If the developer of the repository determines to tag a specific commit (i.e. puts a label with a nice name on the commit hash like "version 1.0"), the contents of the repository is made available as a ZIP/TAR file on Github for your convenience. There should be no difference between the two, besides the version of it as the clone command is likely to give you a newer (probably experimental) version.

To make things more complicated, but necessary to be correct in this answer, the clone only checks out the default branch, whereas the ZIP-file on Github may be created from a tag in another branch (release for example).

As stated in the comment, further instructions on how to install this particular piece of software is documented very well in the README.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.