Mehrdad Salimi
Mehrdad Salimi

Reputation: 1426

There is no "zip download" button to download source in .zip on github

I want to download this source file in the zip here:

https://github.com/xdtianyu/android-4.2_r1/tree/master/packages/apps/SoundRecorder

But there is no Zip Download button. There is a Zip Download button in the root directory of the repository:

https://github.com/xdtianyu/android-4.2_r1

But I don't want to download the whole repository. How can I download that single project (specific subdirectory)?

I read this topic but still, I can't Download source as the zip file:

Download single files from GitHub

How to download source in ZIP format from GitHub?

Upvotes: 24

Views: 62917

Answers (2)

Minhas Kamal
Minhas Kamal

Reputation: 22196

Use DownGit; you can download individual files or directories, and even create download-link for them-

image

You can also configure properties of the download-file. See here for detailed usage.


Disclaimer: I fell into the same problem as the question-asker, could not find any proper solution, so I created this tool for my own use, and later made it available for everyone.

Upvotes: 27

Chris
Chris

Reputation: 137139

You can't download a subdirectory from GitHub as a zip file.

Some options are to

  • download the full zip and manually extract the subdirectory that you want, or
  • use git with sparse checkouts instead of downloading as a zip file.
    • This approach does download the entire repository into the .git directory, but your working copy will only contain the files and directories that you want.

For more information on sparse checkouts have a look at this answer.

Upvotes: 32

Related Questions