o2fasg
Last Updated: August 16, 2016
·
33.44K
· janosgyerik
32ef4e3e388cbadc756a008cade3ee6a

How to download a project subdirectory from GitHub

If you want to download an entire project from GitHub without version control data, you can use the Download ZIP option of the website. Alternatively, you could use command line tools, for example:

curl -L https://github.com/janosgyerik/jquery-upvote/tarball/master > project.tar.gz

What if you want to download only a subdirectory? The website doesn’t have an option for that, at least not yet. Not a problem! Thanks to Subversion support in GitHub, you could use the svn command line tool to that effect, for example:

svn export https://github.com/janosgyerik/jquery-upvote/trunk/lib jquery-upvote-lib

This creates a directory locally with the content of the specified subdirectory of the project.

Just make sure to construct the URL correctly, using the format:

https://github.com/USER/PROJECT/trunk/PATH DEST

Inspired by the question on #stackoverflow: git export from github remote repository

Say Thanks
Respond

3 Responses
Add your response

16141
7032e676c9790e067cba9cb68c61ae88

I don't have svn/git and don't plan to install either. I just want the subdirectory. What do I do?

over 1 year ago ·
16154
32ef4e3e388cbadc756a008cade3ee6a

@markjeronimus If I knew how to do it without svn, I would have answered that way... Unfortunately I don't :( So you have to either download the entire repo using GitHub's own download feature, or install svn to use this hack.

over 1 year ago ·
26714
None

Finally I found what i need it really helped Thanks janosgyerik

over 1 year ago ·
Filed Under