What is Github Gist?

GOAL

Today’s goal is to understand what is Gist and how to use it.

What is Gist?

Gist is a source code sharing service provided by GitHub. Gist manages all or parts of the source of projects or documentations such as a manual.

Gist is used for sharing or versioning source codes or documentations.

The difference between Git, GitHub and Gist.

Git: Git is a distributed revision control system. Refer git page for details.
GitHub: GitHub is a source code hosting service for version control and collaboration using Git. It is a service for sharing the entire project as a repository.
Gist: Gist is a one of the services provided by GitHub. It is a service for sharing the source codes and documentations. You can create a Gist of a single source or a part of the source, too.

Why Gist

Gist documentations can be secrets and be shared by its URL. You can share your documentation as Gist and paste it as script tag <script src=”URL.js”></script> in HTML.

An example of embed Gist.

How to use Gist

1. Input files

Access gist.github.com and input the contents. You can add files by clicking “Add file” button.

This image has an empty alt attribute; its file name is a235091740099a6f2bb7d62bbf945781-1024x741.png

2. Create Gist

Create Gist by clicking button, “Create secret gist” or “Create public gist”.

This image has an empty alt attribute; its file name is a342dd13c17c84a2613f4e2bc96fc3d2.png

3. Share with its URL

You can share created gist with the URL such as https://gist.github.com/s-nako/eff9083f0d17c3c02c8bdce0adf95625.

4. Edit files

The files of Gist can be edited after creating. Click “Edit” button and edit the file. Then the new revision has been created.

This image has an empty alt attribute; its file name is af064448145b02c69076a70630563fa5.png