How do I get source code out of a gist? [closed]

你说的曾经没有我的故事 提交于 2019-12-11 19:59:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!