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).
Go to your Gist and click the Edit button at the top right. The Gist editor will show your files in edit mode, then look at the bottom left and there you will find an 'Add file' button. Click it and the cursor will be moved to the 'File name box..', type a name and click the 'Update gist' button at the bottom right.
How Do I Edit or Delete a Gist? In the top right corner of your gist page, there will be a menu that allows for multiple functions to be performed on your gist. We can edit, delete, unsubscribe, star, embed, copy, share, and download a raw copy or zipped copy of a gist.
Seems like GitHub has a simple REST API, including methods for creating Gists. Just for fun:
$ curl -X POST \ --data-binary '{"files": {"file1.txt": {"content": "Hello, SO"}}}' \ https://api.github.com/gists
This successfully created this Gist. I guess it's enough to get you started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With