我需要从原始gist加载shell脚本,但我找不到获取原始URL的方法.
curl -L address-to-raw-gist.sh | bash
Run Code Online (Sandbox Code Playgroud)
aym*_*met 32
但是,找到raw按钮(在源代码的右上角).
原始URL应如下所示:
https://gist.githubusercontent.com/{user}/{gist_hash}/raw/{commit_hash}/{file}
Run Code Online (Sandbox Code Playgroud)
注意:通过省略{commit_hash}零件可以获得最新版本,如下所示:
https://gist.githubusercontent.com/{user}/{gist_hash}/raw/{file}
Run Code Online (Sandbox Code Playgroud)
Von*_*onC 29
2014年2月:原始网址刚刚改变.
请参阅" Gist原始文件URI更改 ":
所有Gist文件的原始主机立即更改.
进行此更改是为了进一步将用户内容与受信任的GitHub应用程序隔离开来.新主持人是
https://gist.githubusercontent.com.
Run Code Online (Sandbox Code Playgroud)
现有URI将重定向到新主机.
在它之前 https://gist.github.com/<username>/<gist-id>/raw/...
现在它是 https://gist.githubusercontent.com/<username>/<gist-id>/raw/...
例如:
KrisWebDev 在评论中补充道:
如果您想要Gist文档的最新版本,只需删除
<commit>/from URLhttps://gist.githubusercontent.com/VonC/9184693/raw/testNewGist