Skip to content

[GitHub] How to Download a Single Specific Folder

Last Updated on 2022-07-05 by Clay

GitHub is an indispensable platform for software engineers, programmers and students with computer science backgrounds today. We often use it for version control in the cloud, and also look for projects that are open source and we are interested.

But, how do we download a specific folder in a GitHub repository?

As of now (2022/02), the ability to download individual folders is still not supported on GitHub (or does it already exist and I do not know?), but I believe that one day GitHub will launch this convenient feature.

Until that day comes, we can download specific folder individually by:

  • SVN: download using command line
  • DownGit: paste the URL in the browser page to download

I will briefly introduce them in order below.


Method 1: Use SVN Command to Download

We can download individual files through the svn command. If this directive is not available in your environment, you can use:

sudo apt install subversion


to download. (Take Ubuntu/Debian as an example)

Then get the URL of the folder you want to download, for example: https://github.com/ccs96307/font-to-png/tree/master/pic

This is a link to the folder where images are stored in one of my own repository. We also need to change tree/master to trunk.

That said, the link to the folder we’ll end up using is https://github.com/ccs96307/font-to-png/trunk/pic.

If the branch you want is not master/main, then you can change trunk to branches/[BRANCH_NAME].

svn checkout https://github.com/ccs96307/font-to-png/trunk/pic


You can see that the pic folder appears under your current directory.


Method 2: DownGit

I still recommend this useful tool, you just need to go to https://downgit.github.io/#/home and you will see the following screen:

Then paste the link to the folder you want to download, select the download method you want, and you’re done. This method of course does not require any link modification.


References


Read More

Leave a ReplyCancel reply

Exit mobile version