There are two ways to view github content: raw and web pages.
raw.githubusercontent.com returns the raw contents of files stored in github, so you can simply download them to your computer. For example, if the page is a ruby installation script, you will get a ruby installation script that will be understood by your ruby installation.
If instead you download a file using the github.com link, you will actually load a web page with buttons and comments, in which the desired script will be displayed in the right place - this is what you want to give your web browser to get a good page for viewing, but for a computer, this is not a script that can be executed or code that can be compiled, but a web page to display. This web page has a Raw button that sends you to the relevant content on raw.githubusercontent.com .
To see the contents of raw.githubusercontent.com/${repo}/${branch}/${path} in the normal github interface:
- you replace
raw.githubusercontent.com simple github.com - And you insert a "blob" between the repo name and the branch name.
In this case, the branch name is "master" (this is a very common branch name), so you replace /master/ with /blob/master/ , and so on
https://raw.githubusercontent.com/Homebrew/install/master/install
becomes
https://github.com/Homebrew/install/blob/master/install
This is the flip side of finding a file on Github and clicking on the Raw link.
Law29 source share