Skip to main content

Import Gists from GitHub

Importing Github Gists via Snippet Discovery

Before proceeding to work with Gists from GitHub in Pieces, make sure that you are signed in. If you are signed in to both Google and GitHub, be sure that the primary emails on both accounts match.

Sharing Snippets as GitHub Gists​

GitHub Gists are a great way to share code with a group of people for public visibility, and integrate your snippets with your GitHub repositories. Pieces makes it easy to update your Gist repository by enabling you to share saved code snippets within Pieces as Gists, right from the desktop app.

Generating a shareable link in the Pieces desktop app

  1. After signing in and ensuring that you are connected to the cloud, select any snippet in the desktop app.
  2. Click the "Shareable Link" icon on the Action menu nested on the right side of your screen.
  3. Select the GitHub logo to the right of your shareable link inside the input.
    • If you have not authenticated with GitHub you will have to in order to generate a Gist.
  4. (Optional) Create a title and a description. You can create a title and a description from here, or you can skip this step and a generated title will be created for you.
  5. Press "Generate," and you'll get the link to the Gist, where it can be found on your list of public gists on your GitHub account.

Bundled Metadata Preview​

Every Gist has a Markdown Preview built using our Context Awareness Engine and Origin Details which includes relevant and related information to the snippet's context.

How to Import Gists to Pieces Desktop​

To import the Gists and upgrade them:

  1. Navigate to 'Add Snippets' > 'Import Gists'
  2. The Snippet Discovery window will open, as we use our Snippet Discovery feature to enrich your snippets as you import them from GitHub. This way, your Gists will maintain their context.
  3. Once you press "Select Gists," in a similar way as Snippet Discovery, you will be presented with a list of Snippets that have been discovered from your GitHub account.
    • If you're not seeing your Gists, make sure they are set to public. Otherwise, they will not be detected.
  4. Select the Gists that you want to save by pressing the checkbox to select each one individually or by pressing "save all" in the top right.
  5. You will be brought back to your default view where you can see all the snippets that you just discovered from your Gists.

Gist Metadata​

Each code snippet that you save as a Gist is packed full of metadata and information about the repository you saved it from. Traditionally, when you save a Gist, its origin is lost unless you take extra steps to click through dozens of pull requests and commits. Now, we automatically keep track of this crucial information with our Context Awareness Engine and Origin Details.

Some of the metadata that you may get when importing Gists into the Pieces Desktop App are:

  • Related links to URLs about the repo the code came from
  • Commit history included inside the description of the snippet
  • Resource documentation links for packages used in the config files
  • Other users that are included in the comments or pull request

Where can I see this newly uncovered data?​

If you toggle to the Context View, you can find all the metadata that came through from GitHub and edit it as you like.

Learn more about managing enrichments and saved materials.