How can I download only a specific folder or directory from a remote Git repo hosted on GitHub?
Say the example GitHub repo lives here:
git@github.com:foobar/Test.git
Its directory structure:
Test/
foo/
a.py
b.py
bar/
c.py
d.py
I want to download only the foo folder and not clone the whole Test project.
1.Click on this link http://kinolien.github.io/gitzip/
2.Paste link of Github folder you want to download.
3.Click on search it will shows all files for downloading.
Note:-Using search there is no need to enter token key ;)..keep it simple(y)
Whoever is working on specific folder he needs to clone that particular folder itself , todo so please follow below steps ** --- by using SPARSE CHECKOUT --- **
Step 1: Create a directory.
Step 2: Initialize a Git repository. (
git init
)Step 3: Enable Sparse Checkouts. (
git config core.sparsecheckout true
)Step 4: Tell Git which directories you want (echo 2015/brand/May( refer to folder you want to work on) >>
.git/info/sparse-checkout
)Step 5: Add the remote (
git remote add -f origin https://jafartke.com/mkt-imdev/DVM.git
)Final Step 6: Fetch the files (
git pull origin master
)Go to DownGit > Enter Your URL > Download!
Now, you can DIRECTLY DOWNLOAD or create DOWNLOAD LINK for any GitHub public directory or file (specially large file) from DownGit! Here is a simple demonstration-
You may also configure the downloaded file's property- detailed usage.
There's a Python3 pip package called
githubdl
that can do this*:The project page is here
* Disclaimer: I wrote this package.
I've created an open source project, called GitHubFolderDownloader. It lets you to download a single folder of a repository without cloning or downloading the whole repository.
You can do a simple download of the directory tree:
But if you mean to check it out, and be able to do commits and push them back, no you can't do that.