问题
How do I get source code out of a gist?
These are supposed to be like git repositories, but git clone GIST.gist did not work. I can't find anything resembling a command line option that unzips or otherwise turns these things into source code file(s).
edit: I was given a .gist file, this is what needs to be unpacked. It looks like JSON code (or something)
回答1:
All gists are git repositories. The gist page has some information about how to clone the git repo of the gist. For example, with a silly gist I created a while ago, you can copy the url https://gist.github.com/4599778.git
and on the command line:
git clone https://gist.github.com/4599778.git
Or, an even easier way to do this is to just copy and paste from the page itself.
Now, it is also possible to use the github REST api to do this, but I don't think that's what you are asking here.
来源:https://stackoverflow.com/questions/22798320/how-do-i-get-source-code-out-of-a-gist