Skip to content

Instantly share code, notes, and snippets.

@petonic
Forked from atenni/README.md
Last active May 5, 2018 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petonic/cf13933b4200bb4abd2ee6a28211592a to your computer and use it in GitHub Desktop.
Save petonic/cf13933b4200bb4abd2ee6a28211592a to your computer and use it in GitHub Desktop.
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

You can find the filename by going to the gist, editing the raw file, and then taking the last path component of the URL, eg "@03%2520hassio-ssh-zshrc"

(via: http://stackoverflow.com/a/14529686)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment