I need to load a shell script from a raw gist but I can't find a way to get raw URL.
curl -L address-to-raw-gist.sh | bash
With the raw view, you can view or copy the raw content of a file without any styling. On GitHub.com, navigate to the main page of the repository. Click the file that you want to view. In the upper-right corner of the file view, click Raw.
The only way you can do it using GithubGist is to open each and every individual gist to download ZIP or clone via HTTP or SSH. This article is all about making the above task simpler. Using the commands below, you can even download gists from other github users excluding the private ones until you know their password.
Once you have logged into your GitHub account, click on your username in the top right corner. This will open a menu where you can see an option called 'Your gists'. Once you clicked that option, you will see your gist page.
And yet there is, look for the raw
button (on the top-right of the source code).
The raw URL should look like this:
https://gist.githubusercontent.com/{user}/{gist_hash}/raw/{commit_hash}/{file}
Note: it is possible to get the latest version by omitting the {commit_hash}
part, as shown below:
https://gist.githubusercontent.com/{user}/{gist_hash}/raw/{file}
February 2014: the raw url just changed.
See "Gist raw file URI change":
The raw host for all Gist files is changing immediately.
This change was made to further isolate user content from trusted GitHub applications.The new host is
https://gist.githubusercontent.com.
Existing URIs will redirect to the new host.
Before it was https://gist.github.com/<username>/<gist-id>/raw/...
Now it is https://gist.githubusercontent.com/<username>/<gist-id>/raw/...
For instance:
https://gist.githubusercontent.com/VonC/9184693/raw/30d74d258442c7c65512eafab474568dd706c430/testNewGist
KrisWebDev adds in the comments:
If you want the last version of a Gist document, just remove the
<commit>/
from URLhttps://gist.githubusercontent.com/VonC/9184693/raw/testNewGist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With