defunkt/gist

When updating a gist, the URL returned for --raw is not specific to the file

travisdowns opened this issue · 0 comments

When updating a gist, the URL returns simple contains the hash of the gist itself, not the file. So for example --raw will return a value that shows the last updated or "top" file in the gist, not necessarily the added file, like so:

https://gist.github.com/travisdowns/50c6fb04cf1e6fdbd03471361a2b317e/raw

To link to the specific file uploaded, you add the filename, like:

https://gist.github.com/travisdowns/50c6fb04cf1e6fdbd03471361a2b317e/raw/foo.txt

or the commit and filename:

https://gist.githubusercontent.com/travisdowns/50c6fb04cf1e6fdbd03471361a2b317e/raw/79f49165d8259c3b595f081f23360e74e3245456/foo.txt

The latter format refers to the specific version of the file even if it is updated, while the former shows the newest version of the file.

Without this, the link returned by gist isn't useful for multi-file gists.