Article version: Enterprise Server 2.16

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-01-22. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Creating gists

You can create two kinds of gists: public and secret. Create a public gist if you're ready to share your ideas with the world or a secret gist if you're not.

In this article

About gists

Every gist is a Git repository, which means that it can be forked and cloned. If you are signed in to GitHub Enterprise 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, http(s)://[hostname]/gist or http(s)://gist.[hostname] if subdomains are enabled .

Gists can be public or secret. Public gists show up in Discover, http(s)://[hostname]/gist/discover or http(s)://gist.[hostname]/discover if subdomains are enabled, 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, http(s)://[hostname]/gist/discover or http(s)://gist.[hostname]/discover if subdomains are enabled, 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.

If your site administrator has disabled private mode, you can also use anonymous gists, which can be public or secret.

Warning: Anonymous gists cannot be deleted from the web browser. To have an anonymous gist deleted, contact your GitHub Enterprise site administrator. Please provide the URL of the gist you wish to delete.

You can discover gists others have created by going to the gist home page, http(s)://[hostname]/gist or http(s)://gist.[hostname] if subdomains are enabled 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, http(s)://[hostname]/gist/search or http(s)://gist.[hostname]/search if subdomains are enabled. 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".

You can download a ZIP file of a gist by clicking the Download ZIP button at the top of the gist. You can embed a gist in any text field that supports Javascript, such as a blog post. To get the embed code, click the clipboard icon next to the Embed URL of a gist. To embed a specific gist file, append the Embed URL with ?file=FILENAME.

Creating a gist

You can also drag and drop a text file from your desktop directly into the gist editor.

  1. Sign in to GitHub Enterprise.

  2. Navigate to your gist home page, http(s)://[hostname]/gist or http(s)://gist.[hostname] if subdomains are enabled .

  3. Type an optional description and name for your gist.

    Gist name description

  4. Type the text of your gist into the gist text box.

    Gist text box

  5. Do one of the following:

    Note: After creating a gist, you cannot convert it from public to secret.

Ask a human

Can't find what you're looking for?

Contact us