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