How to download source in ZIP format from GitHub?

GitGithub

Git Problem Overview


I see something strange like:

http://github.com/zoul/Finch.git

Now I'm not that CVS, SVN, etc. dude. When I open that in the browser it tells me that I did something wrong. So I bet I need some hacker-style tool? Some client?

(I mean... why not just provide a ZIP file? Isn't the world complex enough?)

Git Solutions


Solution 1 - Git

What happens when the repository owner has not prepared a zip file, and you just want a download to use yourself? There is an answer and you don't need to go though that horrid process to download software, install and register keys and whatnot on GitHub, etc.!

To simply download a repository as a zip file: add the extra path '/zipball/master/' to the end of the repository URL and voila, it gives you a zip file of the whole lot.

For example,

> http://github.com/zoul/Finch/

becomes:

> http://github.com/zoul/Finch/zipball/master/

It then gives you a zip file to download.

Solution 2 - Git

To clone that repository via a URL like that: yes, you do need a client, and that client is Git. That will let you make changes, your own branches, merge back in sync with other developers, maintain your own source that you can easily keep up to date without downloading the whole thing each time and writing over your own changes etc. A ZIP file won't let you do that.

It is mostly meant for people who want to develop the source rather than people who just want to get the source one off and not make changes.

But it just so happens you can get a ZIP file as well:

Click on http://github.com/zoul/Finch/ and then click on the green Clone or Download button. See here:

enter image description here

Solution 3 - Git

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:

Download ZIP (2013)


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 - Git

To download your repository as zip file via curl:

curl -L -o master.zip http://github.com/zoul/Finch/zipball/master/

If your repository is private:

curl -u 'username' -L -o master.zip http://github.com/zoul/Finch/zipball/master/

Source: Github Help

Solution 5 - Git

As of December 2016, the Clone or download button is still under the <> Code tab, however it is now to the far right of the header:

Github Clone or download screenshot

Solution 6 - Git

Even though this is fairly an old question, I have my 2 cents to share.

You can download the repo as tar.gz as well

Like the zipball link pointed by various answers here, There is a tarball link as well which downloads the content of the git repository in tar.gz format.

curl -L http://github.com/zoul/Finch/tarball/master/

A better way

Git also provides a different URL pattern where you can simply append the type of file you want to download at the end of url. This way is better if you want to process these urls in a batch or bash script.

curl -L http://github.com/zoul/Finch/archive/master.zip

curl -L http://github.com/zoul/Finch/archive/master.tar.gz

To download a specific commit or branch

Replace master with the commit-hash or the branch-name in the above urls like below.

curl -L http://github.com/zoul/Finch/archive/cfeb671ac55f6b1aba6ed28b9bc9b246e0e.zip    
curl -L http://github.com/zoul/Finch/archive/cfeb671ac55f6b1aba6ed28b9bc9b246e0e.tar.gz --output cfeb671ac55f6b1aba6ed28b9bc9b246e0e.tar.gz

curl -L http://github.com/zoul/Finch/archive/your-branch-name.zip
curl -L http://github.com/zoul/Finch/archive/your-branch-name.tar.gz --output your-branch-name.tar.gz

Solution 7 - Git

Here's a good reference if you want to do it from the command line: http://linuxprograms.wordpress.com/2010/10/26/checkout-code-from-github/

Basically it's

git clone http://github.com/zoul/Finch.git

Solution 8 - Git

I've been stumped by this too. The "Download" button is to the far right, but you also need to be in the top folder in order to download what you're seeing. Go up as high as you can to the parent/root folder and then look for the download button.

Solution 9 - Git

For people using Windows and struggling to download repo as zip from terminal:

url -L http://github.com/GorvGoyl/Notion-Boost-browser-extension/archive/master.zip --output master.zip

Solution 10 - Git

Sometimes if the 'Download ZIP' button is not available, you can click on 'Raw' and the file should download to your system.

Solution 11 - Git

As of June 2016, the Download ZIP button is still under the <> Code tab, however it is now inside a button with two options clone or download:

Symfony image example

Solution 12 - Git

In chrome, if you hover your cursor on Download ZIP it will give you the link at the bottom of the browser

enter image description here

Solution 13 - Git

I was facing same problem but accidentlty I sorted this problem.

  1. Login in github
  2. Click on Fork Button at Top Right.
  3. After above step you can see Clone or download in Green color under <> Code Tab.

Solution 14 - Git

You can also publish a version release on Github, and there's an option to download the source code of that release in a zip file.

You can then share the zip file link to anyone to download the project source code.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiondontWatchMyProfileView Question on Stackoverflow
Solution 1 - Gituser892731View Answer on Stackoverflow
Solution 2 - GitKurtView Answer on Stackoverflow
Solution 3 - GitManav KatariaView Answer on Stackoverflow
Solution 4 - GitWillyView Answer on Stackoverflow
Solution 5 - GitBendyView Answer on Stackoverflow
Solution 6 - GitRaja AnbazhaganView Answer on Stackoverflow
Solution 7 - GitPaul BaumerView Answer on Stackoverflow
Solution 8 - GitclamumView Answer on Stackoverflow
Solution 9 - GitGorvGoylView Answer on Stackoverflow
Solution 10 - GitrohanView Answer on Stackoverflow
Solution 11 - GitReginaldo Camargo RibeiroView Answer on Stackoverflow
Solution 12 - GitMina GabrielView Answer on Stackoverflow
Solution 13 - GitAnshul AgarwalView Answer on Stackoverflow
Solution 14 - GitCharles ZhaoView Answer on Stackoverflow