293

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?)

0

15 Answers 15

251

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.

10
  • 4
    Awesome info my friend. There have been many times where I have wanted to download different branches without having to install git. Honestly I don't understand why there just isn't a link for this...
    – Zaptree
    Dec 10, 2011 at 3:20
  • 5
    Wish this worked, but no luck here: github.com/facebook/php-webdriver --when I add "zipball/master/" to the end of that URL, I just get an error message. I'm echoing the original commenter... I just don't understand why it's so f'ing hard to download source code I see on github. I don't want a git client, I don't want to learn git, I just want to pull down the files that are right in front of my face :-)
    – Eric
    Feb 16, 2012 at 0:45
  • 4
    @Eric - it worked for me: github.com/facebook/php-webdriver/zipball/master
    – scubasteve
    Apr 23, 2012 at 23:25
  • 2
    Excellent tip! Just be sure that your are at the top folder of the repository when adding /zipball/master/.
    – Peter H
    Aug 27, 2013 at 9:03
  • 2
    @PeterH Said it - you need to be at the top folder, otherwise 404 error!
    – Ted
    Oct 17, 2016 at 19:43
203

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

5
  • 2
    Is there any way not to have to download the entire repository? Say, if the repository is a "plugins" repo and you only want one plugin?
    – Mala
    Feb 6, 2013 at 19:03
  • 2
    not without using the Github API as far as I know.
    – Christoph
    Feb 11, 2013 at 15:25
  • No such button at that URL. In fact the content at that URL looks nothing like your screenshot. Was the zip download function removed from GitHub?
    – barneypitt
    Aug 28, 2022 at 9:02
  • @barneypitt the green button is still there, but it's now labelled "Code". Just click that green button then click "Downlad ZIP"
    – S Williams
    Aug 30, 2022 at 7:48
  • Thanks. Not sure how I missed that it was under "Code"!
    – barneypitt
    Aug 31, 2022 at 15:09
187

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.

5
  • 5
    Also, if you want a tarball instead of a zip, you can change that URL to say ".tar.gz" at the end.
    – Eric
    Oct 1, 2015 at 15:39
  • 3
    It looks like <>Code is selected by default, but its not. CLICK on it!
    – Steve Wash
    Jul 23, 2016 at 11:18
  • Thanks @SteveWash. That's just crazy. I also thought the Code tab was already selected. That's really poor UI (but, okay, once you learn that trick, you'll know it forever..) Nov 17, 2017 at 14:20
  • If you name your tags like v1.0, the zip file ignores the v & downloads repo-1.0. Is that a bug with github?
    – Debaprio B
    Sep 11, 2019 at 21:20
  • @DebaprioB indeed it is a bug, even though it seems they went out of their way to implement that behaviour 🤔
    – bit2shift
    Apr 22, 2022 at 10:37
44

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

3
  • sweet! worked like a charm, I had permission limits in a batch system with no browser and this one was what I needed! Jan 10, 2014 at 22:30
  • With wget it's even shorter: wget https://github.com/zoul/Finch/archive/master.zip
    – Noam Manos
    May 21, 2020 at 9:49
  • good. but its outdated. Someone please update it. Feb 21, 2023 at 14:43
26

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

6
  • Does this apply to the old layout too?
    – Makoto
    Dec 9, 2015 at 20:48
  • Hey, I don't see that button! github.com/Antonioya/blender/tree/master/measureit Dec 2, 2016 at 2:48
  • 1
    Perhaps because you are not logged in. I just checked and github has changed the layout a bit. However the button is now green and labeled "Clone or download" (for your repository the download button links to: github.com/Antonioya/blender/archive/master.zip )
    – Bendy
    Dec 5, 2016 at 10:47
  • 1
    I logged in and still don't see any green button - instead of "Clone or download" it says "History"
    – Miryafa
    Mar 1, 2017 at 21:54
  • 1
    @Miryafa Because the download is disabled for that repository. Check the note on Readme. It says, "*** NOTICE *** MeasureIt is now part of Blender official releases, so this Git repository is only for reference. If you want download last versions or report a bug, please uses Blender website."
    – Anwar
    Apr 5, 2017 at 6:31
22

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
1
  • 2
    This is exactly what I was looking for - a URL where I can get a tarball of the current master branch using command line. However, you'll want to add -o <file> to your commands or else you'll just get the binary printed to stdout. So, in this example: curl -L https://github.com/zoul/Finch/archive/master.tar.gz -o Finch-master.tar.gz (or whatever you'd like the filename to be). I also added https: for good measure.
    – chimbo
    Nov 1, 2020 at 2:43
13

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
1
  • 5
    this doesn't download as zip
    – GorvGoyl
    Oct 9, 2020 at 11:11
7

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.

0
3

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

1

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

1
  • 1
    Or, as is mentioned elsewhere on this page, even if the "Code" tab looks selected... it might not be. Click on "Code" again, and see if the "Clone or download" button appears. Nov 17, 2017 at 14:22
1

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

1

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

0

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.

0

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.

0

Recently, I found the following tool on GitHub: github-zipball-downloader from repository marencozy/github-zipball-downloader. It can backup all your public repositories as zip archives.

python3 github-zipball-downloader.py -username User1

It will save User1 repositories to local folder with datetime in name.

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