Is there a permalink to the latest version of gist files?

我们两清 提交于 2019-12-03 08:54:09

问题


I created a gist with two files, the raw version of which I would like to use as a reference for an application which will query their contents. These contents will be updated on GitHub.

I found however that the URL of the file changes with each version of the gist. Is there a permalink which would point to the latest version of a file in a gist?


回答1:


Raw gist URLs follow the pattern below:

https://gist.githubusercontent.com/[gist username]/[gist ID]/raw/[gist commit ID]/[file name]

To view the latest version, simply remove the [gist commit ID] part:

https://gist.githubusercontent.com/[gist username]/[gist ID]/raw/[file name]

e.g.

https://gist.githubusercontent.com/mwek/9962f97f3bde157fd5dbd2b5dd0ec3ca/raw/user.js

Keep in mind that the endpoint is cached, so your updates may be visible with a slight delay.



来源:https://stackoverflow.com/questions/46073096/is-there-a-permalink-to-the-latest-version-of-gist-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!