Fastest way to download a GitHub project
I need to download the source code of the project Spring data graph example into my box. It has public read-only access. Is there is an extremely fast way of downloading this code?
I have no idea of working on GitHub/committing code and most tutorials out there on the web seems to assume that "I would want to setup a project in GitHub" and inundate me with 15-20 step processes. To me, if a source repository is available for the public, it should take less than 10 seconds to have that code in my filesystem.
Tutorials that provide me with 15-20 step processes:
- Setting up development environment on Ubuntu
- Win Setup on GIT
I need something very very very simple. Just pull the source code, and I am more interested in seeing the source code and not learn GitHub.
Are there any fast pointers/tutorials? (I have a GitHub account.)
Solution 1:
When you are on a project page, you can press the 'Download ZIP' button which is located under the "Clone or Download" drop down:
This allows you to download the most recent version of the code as a zip archive.
If you aren't seeing that button, it is likely because you aren't on the main project page. To get there, click on the left-most tab labeled "<> Code".
Solution 2:
You say:
To me if a source repository is available for public it should take less than 10 seconds to have that code in my filesystem.
And of course, if you want to use Git (which GitHub is all about), then what you do to get the code onto your system is called "cloning the repository".
It's a single Git invocation on the command line, and it will give you the code just as seen when you browse the repository on the web (when getting a ZIP archive, you will need to unpack it and so on, it's not always directly browsable). For the repository you mention, you would do:
$ git clone git://github.com/SpringSource/spring-data-graph-examples.git
The git:
-type URL is the one from the page you linked to. On my system just now, running the above command took 3.2 seconds. Of course, unlike ZIP, the time to clone a repository will increase when the repository's history grows. There are options for that, but let's keep this simple.
I'm just saying: You sound very frustrated when a large part of the problem is your reluctance to actually use Git.
Solution 3:
Updated July 2016
As of July 2016, the Download ZIP button has moved under Clone or download to extreme-right of header under the Code tab:
If you don't see the button:
- Make sure you've selected <> Code tab from right side navigation menu, or
-
Repo may not have a zip prepared. Add
/archive/master.zip
to the end of the repository URL and to generate a zipfile of the master branch.http://github.com/user/repository/
-to-
http://github.com/user/repository/archive/master.zip
to get the master branch source code in a zip file. You can do the same with tags and branch names, by replacing master
in the URL above with the name of the branch or tag.
Solution 4:
Another faster way of downloading a GitHub project would be to use the clone functionality with the --depth
argument as:
git clone --depth=1 [email protected]:organization/your-repo.git
to perform a shallow clone.
Solution 5:
Downloading with Git using Windows CMD from a GitHub project
Copy the HTTPS clone URL shown in picture 1
Open CMD
git clone //paste the URL show in picture 2