Skip to main content

이 버전의 GitHub Enterprise는 다음 날짜에 중단되었습니다. 2024-09-25. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

gists 만들기

퍼블릭 및 비밀의 두 가지 종류의 gist를 만들 수 있습니다. 자신의 아이디어를 세상과 공유할 준비가 되었으면 퍼블릭 gist를 만들고, 그렇지 않으면 비밀 gist를 만듭니다.

이 문서의 내용

About gists

Gists provide a simple way to share code snippets with others. Every gist is a Git repository, which means that it can be forked and cloned. If you are signed in to GitHub Enterprise Server 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.

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 unless you are logged in and are the author of the secret gist. 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.

After creating a gist, you cannot convert it from public to secret. However, a secret gist can be made public by editing the gist and updating the visibility to public.

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 site administrator. Please provide the URL of the gist you wish to delete.

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 of 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 public 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

Follow the steps below to create a gist.

You can also create a gist using the GitHub CLI. For more information, see "gh gist create" in the GitHub CLI documentation.

Alternatively, you can drag and drop a text file from your desktop directly into the editor.

  1. Sign in to GitHub Enterprise Server.

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

  3. Optionally, in the "Gist description" field, type a description for your gist.

  4. In the "Filename including extension" field, type a file name for your gist, including the file extensions.

  5. In the file contents field, type the text of your gist.

  6. Optionally, to create a public gist, click , then click Create public gist.

    Screenshot of the visibility dropdown menu for a new gist. Next to a button labeled "Create secret gist", a dropdown icon is outlined in dark orange.

  7. Click Create secret Gist or Create public gist.