Download Directory from GitHub
Asked Answered
F

4

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

Frederick answered 15/10, 2019 at 15:16 Comment(1)
Does this answer your question? Download a single folder or directory from a GitHub repoNarrative
M
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.

Maller answered 15/10, 2019 at 15:17 Comment(2)
Git clone works for a 'repository' in git but not just for a folder in the repositoryFrederick
I guess MinhasKamal/DownGit@github will help you a lot.Maller
K
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.

Kef answered 8/7, 2021 at 5:15 Comment(0)
S
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

Scroop answered 6/7, 2022 at 2:13 Comment(0)
A
0

just fork repo. and delete unnessary folders and files from your forked repo. then download repo as zip

Amperage answered 26/1 at 3:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.