6

Trying to download a folder from git.
I tried wget --no-parent -r http://WEBSITE.com/DIRECTORY and also without --no-parent - did not work. curl works fine with single files, I thought wget should get the folder - it does everything but that.

Tried many options as suggested Using wget to recursively fetch a directory with arbitrary files in it none worked

Sam-T
  • 1,877
  • 6
  • 23
  • 51
  • Does this answer your question? [Download a single folder or directory from a GitHub repo](https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo) – ggorlen Aug 09 '22 at 18:16

3 Answers3

4

You should try:

git clone <SSH> or <HTTPS>


Maybe this can help you in a simple way:

DownGit

So, if you instead to use wget to download a directory, just try this. It will pack your target directory into a .zip, so you can curlorwget it.


In default, value of fileName and rootDirectory is set to the name of the downloading file or directory. If you do not want to add the directory itself in the zip, then set rootDirectory=false. Like: this link- https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/MinhasKamal/DownGit/tree/master/res/images&rootDirectory=false, will download a file named images.zip; however the root directory- "images", will not be included in the zip.

If you want to download file- https://github.com/MinhasKamal/DownGit/blob/master/res/images/downgit.png with name- DownGitIcon.zip, then the link will be- https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/MinhasKamal/DownGit/blob/master/res/images/downgit.png&fileName=DownGitIcon


By the way, I used to use SVN to download files/directory from a Git System by route the URL to its trunk. But it's very inconvenient.

Community
  • 1
  • 1
Siro
  • 76
  • 5
  • 2
    `Git clone` works for a 'repository' in git but not just for a folder in the repository – Sam-T Oct 15 '19 at 15:28
  • 1
    I guess [MinhasKamal/DownGit@github](https://github.com/MinhasKamal/DownGit/) will help you a lot. – Siro Oct 15 '19 at 15:41
3

A bit late but in case some one stumbles here later. You can use following tools :

In both tools, you can just enter your url to direct download or create a download link.

0

For those who prefer GUI tools, there is another easy way to download a folder using code sandbox.

Navigate to the folder and replace github to githubbox in the URL. Then on code sandbox go to files pain on the left and hover the mouse over the down arrow, it will show a popup tooltip "Export to Zip". Just click on it to download the folder as a zip file.
reference: Download a single folder or directory from a BRANCH in GitHub repo

Dush
  • 1,185
  • 26
  • 29