Overview
GitHub Gist is the part of GitHub for sharing small pieces of code and text without setting up a full repository. A gist holds one or more files: a snippet, a config file, a log, some notes. Each gist gets its own web address that you can pass to other people.
Gists come in two kinds. Public gists show up in the Discover listing and in search. Secret gists are left out of those listings, but they are not private: anyone who has the link can read them, and GitHub's own documentation recommends a private repository for anything that must stay hidden. A secret gist can later be made public, but a public one cannot be turned secret.
Under the surface every gist is a Git repository, so it keeps a full revision history with diffs and can be forked or cloned. Gists can be embedded in web pages and blog posts, downloaded as a ZIP file, pinned to your GitHub profile, and created from the command line with the GitHub CLI. Reading a gist needs no account, but creating one starts with signing in to GitHub.
Categories
Features
- Share one or more files under a single link
- Public gists listed in Discover and searchable
- Secret gists reachable only by people who have the link
- Full revision history with diffs, since each gist is a Git repository
- Fork and clone other people's gists
- Embed a gist, or a single file from it, in a web page
- Download as a ZIP file
- Create gists from the terminal with gh gist create
- Pin gists to your GitHub profile
Privacy
Secret gists are hidden from Discover and search but can be viewed by anyone with the URL; GitHub recommends a private repository for sensitive code. See the official privacy policy.
Pros & Cons
Pros
- Much quicker than creating a repository for a single snippet
- Revision history is kept automatically
- Anyone can read a shared gist without an account
- Embedding makes it handy for blog posts and documentation
Cons
- You need a GitHub account to create a gist
- Secret gists are not truly private: the link is all anyone needs
- A public gist cannot be switched back to secret
- Not suited to larger projects with folders and collaboration workflows
Community Reviews (0)
No written reviews yet — be the first to rate this tool.