Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 342
WoJ Avatar asked Sep 06 '17 10:09

WoJ


People also ask

What is new gist?

Gist: Is an additional feature added to github to allow the sharing of code snippets, notes, to do lists and more. You can save your Gists as secret or public. Secret Gists are hidden from search engines but visible to anyone you share the url with. For example. If you wanted to write a private to-do list.

What is GitHub Gist link?

What is Gist? Gist is an easy method to share snippets or excerpts of data with others. A gist can be a string of code, a bash script or some other small piece of data. These bits of information are hosted by GitHub as a repository.

How do you upload a GIF to gist?

Create the Gist. Drag an image into the comment field below. This will auto-upload your image file to https://user-images.githubusercontent.com and insert markdown code in the comment field to display the image. Copy this markdown code to your gist.


1 Answers

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.

like image 116
mwek Avatar answered Sep 20 '22 04:09

mwek