Skip to content

Instantly share code, notes, and snippets.

@ghadj
Created June 9, 2025 11:17
Show Gist options
  • Save ghadj/e59f6cbf8adff5729a68d6fd47d9acb1 to your computer and use it in GitHub Desktop.
Save ghadj/e59f6cbf8adff5729a68d6fd47d9acb1 to your computer and use it in GitHub Desktop.
Clone all gists locally

Using the gist command-line tool called gist that simplifies interacting with Gists, including downloading them.

1. Install the gist tool:

macOS (with Homebrew):

brew install gist

Linux (or manually for other OS): You might need to install Ruby and RubyGems first if you don't have them. Bash

gem install gist

You might need sudo before gem install gist depending on your system's Ruby setup.

2. Authenticate gist with your GitHub account:

gist --login

This will prompt you for your GitHub username and password, then generate an API token for gist to use.

3. Create a directory to store your Gists:

mkdir gist_archive
cd gist_archive

4. Download all your Gists:

for repo in $(gist -l | awk '{ print $1 }'); do git clone $repo 2> /dev/null; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment