What Is GitHub Gist And How To Create It -2021

what is github gist

Gist is one of the coolest features of GitHub, which allows you to store and share code snippets with others without having to create a fully-fledged repository on GitHub. It doesn’t necessarily need to be just code snippets, it can be anything like a string of code, a bash script, markdown, text file, or some other small piece of data. It can be used for quickly sharing a piece of code with others for anything like a demonstration, guide, or any solution without creating a conventional repo. You can also use it to embed it on your site or elsewhere. 

However a gist also supports many features of repository like you can fork it, clone it or even you can view workflow on a single gist just like repository.

What is GitHub gist used for

There are many things you can do with GitHub’s gists, not big tasks but maybe some task to boost your productivity. :

  1. Share code snippets with other without a fully fledged repository
  2. Embed your code snippets in your blog or website
  3. Publish gists in rich text
  4. Gist as writing platform
  5. Host single page website on gist
  6. Maintain a task list
  7. Gist as a web clipper

If you want to learn how to do any of these, then you can visit here
Also read- How to toonify yourself -with codes

How to make GitHub gist

Creating gist is not a big task, it’s very easy. Below are the steps you can follow to create your own.

  • Go to GitHub website or you can also visit GitHub’ gist website
  • Then login to your account or if you don’t have any then you need to create it
  • After that you can navigate to Create menu(plus icon)> new gist. You will find create menu on the left side of your profile icon. If you are already on the GitHub gist website you can simply click on create menu.
what is github gist
Create gist
  • Now, you will see a page like this Here you can fill the description (about your gist, not necessary) and name of your file. Your file name should contain the file extension(file type) based on your gist for example if you are creating any python sample gist then you can add .py at the end of you file like “hello.py”.
what is github gist
gist window
  • After writing your code you can make it either public or private. If you make it private, no one will be able to see it except the person with your gist url (with whom you share). 
Make your gist public or private
Make it public or private
  • That’s it, it’s ready now you can share it with anyone you like. So for the demo purpose, I have created it public and you can see how it looks when you embed it in your website

If you also want to embed it you can copy the embed code of your gist

how to embed gist in your website
embed code

If you want to see your all gist, you can see it by just navigating to your profile>your gists in both GitHub’s and gits website

what is github gist
See your all gists

GitHub vs gist: what are the difference

Well, This is not intuitive to compare them but even if you try, it is like comparing notepad with Microsoft word, you can only do selective things with gist in comparison to GitHub. You can share just code snippets with gists but with GitHub you can share the entire project as repo. Also with GitHub you can collaborate with others which you can’t with gists. 

To conclude, I would say you can use gist if you want to share something like implementation of a small feature or some kind of tips or want to help someone etc. And you can use GitHub if you are working on a big project like if you are building any website, mobile or web application or working on your assignment with your teammates. If you want to learn more about it you can visit here

Share this post
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email
If you love this article, You can support me on Patreon 🙂

Your support will help me on growing this site, sharing great articles, projects, and cheatsheets. 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments