2017-09-06 130 views
0

我用兩個文件創建了一個要點,我想用它作爲查詢其內容的應用程序的參考的原始版本。這些內容將在GitHub上更新。是否有最新版本的gist文件的固定鏈接?

但是我發現文件的URL隨每個版本的要點而改變。 是否有一個永久鏈接指向一個主要文件的最新版本?

回答

2

原始要旨網址按照下面的模式:

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

要查看最新版本時,只要將[gist commit ID]部分:

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

例如

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

請記住,端點緩存,所以您的更新可能會稍微延遲可見。

相關問題