Every gist is a Git repository, which means that it can be forked and cloned. If you are signed in to GitHub when you create a gist, the gist will be associated with your account and you will see it in your list of gists when you navigate to your gist home page.
Gists can be public or secret. Public gists show up in Discover, where people can browse new gists as they're created. They're also searchable, so you can use them if you'd like other people to find and see your work. After creating a gist, you cannot convert it from public to secret.
Secret gists don't show up in Discover and are not searchable. After creating a gist, you cannot convert it from public to secret. Secret gists aren't private. If you send the URL of a secret gist to a friend, they'll be able to see it. However, if someone you don't know discovers the URL, they'll also be able to see your gist. If you need to keep your code away from prying eyes, you may want to create a private repository instead.
You'll receive a notification when:
- You are the author of a gist.
- Someone mentions you in a gist.
- You subscribe to a gist, by clicking Subscribe at the top any gist.
You can pin gists to your profile so other people can see them easily. For more information, see "Pinning items to your profile."
You can discover gists others have created by going to the gist home page and clicking All Gists. This will take you to a page of all gists sorted and displayed by time of creation or update. You can also search gists by language with Gist Search. Gist search uses the same search syntax as code search.
Since gists are Git repositories, you can view their full commit history, complete with diffs. You can also fork or clone gists. For more information, see "Forking and cloning gists".
Gist supports mapping GeoJSON files. These maps are displayed in embedded gists, so you can easily share and embed maps. For more information, see "Mapping GeoJSON files on GitHub."
You can also drag and drop a text file from your desktop directly into the gist editor.
Sign in to GitHub.
Navigate to your gist home page.
Type an optional description and name for your gist.
Type the text of your gist into the gist text box.
Do one of the following:
- To create a public gist, click Create public gist.
- To create a secret gist, click Create secret Gist.
Note: After creating a gist, you cannot convert it from public to secret.