githubrevisiongist

How to get the ID of a specific gist revision?


I try to use the following link template to reference different revisions of a gist:

https://gist.githubusercontent.com/<username>/<gist-id>/raw/<revision-id>/<filename>

but I can only get the latest <revision-id> when accessing the 'raw' version of the file.

How to get the <revision-id> of an arbitrary revision?


Solution

  • The template you use should work. Make sure you replace <revision-id> with the correct commit hash. In the GitHub UI, go to Revisions, find the proper one, on the file under ... click View file, and then the Raw button.