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.


5 Answers 5


If you're viewing the contents of the file itself there should be a "Raw" button.

get raw

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.

  • 1
    Those links go the the html page for that file, not the file itself. (Unless you're referring to another file list, in which case you should extend your answer to describe how to get to that file list) Dec 23, 2015 at 17:03
  • 1
    @CodesInChaos: It works just fine. Yes, if you just click the link it will open GitHub's page for that file, but "Save link as..." saves the file in its "native format".
    – ale
    Dec 23, 2015 at 19:13
  • This doesn't seem to work with HTML files.
    – Zenadix
    Dec 23, 2015 at 19:24
  • 1
    For me it never works (Using Firefox). It always downloads github's html page for that file. Dec 23, 2015 at 20:53
  • 1
    Tested it in chrome and it doesn't work either. The downloaded file still contains html. Did you check the content of the file? Dec 23, 2015 at 21:14

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


If you are using the Chromium browser, just hold down the ALT key and left click on the file to download it.

(Doesn't work with Mozilla Firefox, haven't tested other browsers.)


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.