Github gist editing without changing URL Github gist editing without changing URL javascript javascript

Github gist editing without changing URL


Gist changed the path to this file pattern:

https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_REVISION_ID>/<GIST_FILE_NAME>

You will notice that now the top answers' links are 404'ing.

Simply apply this new pattern and voilĂ !

https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_FILE_NAME>

For instance:

https://gist.githubusercontent.com/wesbos/cd16b8b1815825f111a2/raw/lol.js


In case of gist,
https://raw.github.com/gist/[gist_id] OR
https://gist.github.com/[user_name]/[gist_id]/raw(which is more likely to be an unique URI.)
returns first file from the gist.

For gist with multiple files,https://raw.github.com/gist/[gist_id]/[file_name]

The url works even when you change the filename.

e.g. https://raw.github.com/gist/4636655https://raw.github.com/gist/4636655/imdb-getglue.js


Just add /raw to the end of your gist url.

https://gist.github.com/--user--/--id--/raw

This links to the latest revision of that file.

After updating the gist file, changes are reflected after a minute or two.