How To Download A Folder From Github
Data on GitHub: The easy way to make your data available. June 13, 2012. By Christopher Gandrud. You can upload other types of files to GitHub, but if you save it in a text-based format others can directly suggest changes and you can more easily track changes. When finished, enter the following command to make sure the permissions are correct on the file you just download (and fix them if not). When you send files to GitHub, you commit them.
I only need one particular file from a project published on GitHub so it makes little sense to download the whole project. But I just can't find the download button.
4 Answers
If you're viewing the contents of the file itself there should be a 'Raw' button.
You can either:
- Right-click on that and select the 'Save content as..' (or similar depending on your browser)
- Click through to see the contents dumped onto the screen and save from there
In the list of files, every filename is a link. A simple right-click and 'Save link as..' (or equivalent for your browser) will allow you to download a single file.
This breaks down with HTML files, however. You'll need to use the 'Raw' button on the file page as Eight Days of Malaise's answer describes. I'm using Google Chrome. You may have a different experience on a different browser.
Check out RawGit which is a free service to serve files directly from Github with proper Content-type headers.
Example URL:https://rawgit.com/user/repo/branch/file
You can try github-files-fetcher, it is a command line tool which downloads a single folder or file from a GitHub repo.
Think a real scenario: you were visiting the following webpage page and wanna download the async
subdirectory alone.
With The github-files-fetcher
, you should first copy the url
of that page, which is https://github.com/reduxjs/redux/tree/master/examples/async, and then run the command below in command line:
fetcher --url=https://github.com/reduxjs/redux/tree/master/examples/async
Not the answer you're looking for? Browse other questions tagged github or ask your own question.
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:
How To Download A File From Github
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:
How To Download A Folder From Github Mac
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: Xbox 360 controller driver blinking pc.
Inspired by the question on #stackoverflow: git export from github remote repository