I don't know if this exists yet, but I'd love to be able to do:
$ cat mygist.js | gh new gist
And have it return the URL (and possibly copy it to the clipboard / open it in the browser).
I don't know if this exists yet, but I'd love to be able to do:
$ cat mygist.js | gh new gist
And have it return the URL (and possibly copy it to the clipboard / open it in the browser).
Try this gem: https://github.com/defunkt/gist
Worked for me ^_^
A super simple command I like to use for making gists out of
diff
s is:git diff origin master -U15 | gist -t diff
Where
15
is the line spacing you can have before and after the change (So it's easier to see differences in larger files.)-t
is thetype
flag.Have the same desire I found https://www.npmjs.com/package/gistup and fork the repository to https://github.com/CrandellWS/mkg because the developer did not want to support Windows which was the operating system being used at the time. So I reworked the npm package to work on windows as well as linux and apple...
Full source is available on GitHub: https://github.com/CrandellWS/mkg
Installation is simple with npm
Use is discribed on the npmjs package page: https://www.npmjs.com/package/gistup
Once installed simply
cd
to which every directory you want to make a gist from...(remeber there are no subfolders with Gists)and run the command:
and it will open your new gist in a broswer...additionally you will be able to control it like a normal git from there... just no subfolders...
https://stackoverflow.com/a/41233970/1815624
Seems like GitHub has a simple REST API, including methods for creating Gists. Just for fun:
This successfully created this Gist. I guess it's enough to get you started.
As Ronie said above, there is a gist gem which provides a gist command that you can use from your terminal to upload content to https://gist.github.com/
To upload the contents of a.rb just:
More info http://defunkt.io/gist/
Here's a simple bash script that takes a filename and makes it a gist.
FYI: gist replies with the post body, so if the file is big, perhaps grep just the relevant parts of the reply.