Gist? It’s already a lot of concepts on GitHub and now we’re adding one more thing to learn!?
A BIG NO !, it is making our lives simply easier.
GitHub Gist
Ok So, what’s that GitHub Gist?
The gist is a very easy method, to share our code snippet with others.
Hnn? Only Code? Actually no, you can share a piece of the data which can be anything, with others.
Will that sharing piece be private or public?
A gist can be either public or secret. If you are logged in to GitHub when you create a gist, it will show up in your dashboard. You can also drag and drop a file onto your gist editor and it will be added.
Fun fact: Not only it is free but it is easy to create.
So we have got some intro to GitHub Gist so now let us get into ‘How to create one?’
Step 1. Get onto github.com and click New Gist
option from New Drawer.
Now you’re welcome to the GitHub Gist pages to create a new one.
Step 2. Give some description of the gist you’re creating.
Step 3. Now, you can provide the filename you want with the extension of the file type you’re associating with.
Step 4. Type some sort of code into the input field.
P.S. -> Remember to code the same you’ve associated the extension type.
Step 5. Hurray !! Now it’s time to publish the code for peeps around the world. So now you have two options, one is to make the gist public so that everyone can enjoy it or secret to make it as a note for yourself.
So let’s make this gist public for this blog.
Step 6: So now, you’ve created your gist and it is published and can be shared among the peers.
For sharing it among your peers, you can copy down the link from slide-down options.
Now let’s take a short real-time example :
Suppose we’re to share some data using tables all over the internet so here the GitHub Gists comes into play.
- As of now, I’m creating a new gist with the name
blogs.md
, a markdown file that will contain my blog's name and link.
Well, gist also provides a preview of the upcoming markdown file.
2. Filling in all the details for blogs.
3. Looking out for being public gist or secret. As of now public because we do want to share the blogs with folks and search engines do look for them.
Public gist
4. Since I published my blog.md
publicly so everyone will be able to search and find my resources for blogs.
Preview of my Gist if someone took out my shared link and tried to reach me.
Some points to be considered for GitHub Gist :
1. You can clone the gist into your local repository and edit the markdown and push it again for revision
2. Certainly there is no provision for Pull Request so one has to comment to get things updated.
Link to my blog.md :
gist.github.com/TauqeerAhmad5201/b3a4d3aa5c..
Hope you will be using GitHub Gist more as of now for sharing the pile of data or code over the internet making things rapid.