github

Downloading raw files from github

If you want to download a file directly non-interactively from github (for example in a script), you get some HTML page showing the file with line numbers etc. So if you want to download the file raw, you just modify the URL, as follows:

If you want to get https://github.com/<my>/<repo>/<file>
You use as URL: https://github.com/<my>/<repo>/raw/<file>

And if you want to download this file from a certain branch on the repo, you use: https://github.com/<my>/<repo>/raw/<branch>/<file>

where:

  • <my> is the user or organization name on github
  • <repo> is the repository name
  • <branch> is a branch on the repository
  • <file> is the file you want to download
Saturday, February 7th, 2015 github No Comments