Skip to content

Instantly share code, notes, and snippets.

@mezz
Last active March 21, 2024 23:04
Show Gist options
  • Save mezz/c3f0931344d81afd366e0d85a8ed1031 to your computer and use it in GitHub Desktop.
Save mezz/c3f0931344d81afd366e0d85a8ed1031 to your computer and use it in GitHub Desktop.
Creating a Gist and getting the URL

Gist is a service hosted by GitHub that lets you paste unlimited amounts of text if you have a GitHub account.
This document explains how to create a Gist from a text document so that you can share it with others.

Manually:

It is simple to create a gist from a text file.

Tech-Savvy Instructions

  1. Copy-paste the contents of the text file to the large text box on https://gist.github.com
  2. Create a public gist and copy the browser's url.

Detailed Instructions

  1. Open the text file so that you can view the text.
  2. Select all the text from the text file.
    (use the hotkey combo ctrl+A on Windows and Linux, or cmd+A on Mac).
  3. Copy all the selected text to your clipboard.
    (use the hotkey combo ctrl+C on Windows and Linux, or cmd+C on Mac).
  4. Open https://gist.github.com to start creating a new gist.
  5. Paste the text into the large text box
    (use the hotkey combo ctrl+V on Windows and Linux, or cmd+V on Mac).
  6. Click "Create public gist".
  7. Select the text in your web browser's address bar.
    (use the hotkey combo ctrl+L on Windows and Linux, or cmd+L on Mac).
  8. Copy the URL to your new gist from your web browser's address bar.
    (use the hotkey combo ctrl+C on Windows and Linux, or cmd+C on Mac).

Command Line:

If you are comfortable with using the command line in a terminal, you can create a gist efficiently.

Setup

  1. Install GitHub command line

Instructions

  1. Mac: Run the command gh gist create --public <path/to/filename.log> | pbcopy
  2. Windows: Run the command gh gist create --public <path/to/filename.log> | clip
  3. Linux: install a terminal clipboard interface like xclip so you can be cool too or just copy the output of the command.

The gist is created and the url has been copied to your clipboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment