Host your code with ❤ by GitHub Gist

Jayamini samaratunga
3 min readJun 9, 2021

What is GitHub?

GitHub is a free and open-source code hosting platform for version control and collaboration. Github lets you and your team work together on projects.

GitHub gists

Every gist is a Git repository that can be forked and cloned. if you have signed in to github when you create a gist, gist will be associated with your account and you will be able to view them in your list of gists when you navigate to the gists home page.

There are two types of gists, Public and Private.

  • Public gists will show up in Discover and they are also searchable.
  • Secret gists don’t show up in Discover and are not searchable but secret gists are not private. If you send the URL of it to a friend or when you share it on your website it will be visible to others.

Gist is a simple way to share code snippets with others.

Let’s see how to host your code snippets via GitHub gists with ❤

Step 1: Create a Gist

  1. Log in to your GitHub account
  2. Click the gist link as shown below or go to gist.github.com
  3. Fill the file name with a proper extension ( description is optional )
  4. Type your code

5. You can also click Add File at the bottom to split your code into several different files if you need.

6. Click create public gist or private gist up to your requirement.

Then your created gist will look like this,

Setp2: Git the link to your gist

You can also get the embed link and paste the script tag on your website to share your code snippets.

Now you can paste the sharable link on your blog post to share it with your readers.

And.. that’s how you host your code snippets with ❤ by GitHub

I hope you found this article useful!

Thank you,

See you soon 😊

--

--