Skip to content

Instantly share code, notes, and snippets.

@ramn
Last active July 21, 2023 13:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ramn/226356dd66b9eaa4c079 to your computer and use it in GitHub Desktop.
Save ramn/226356dd66b9eaa4c079 to your computer and use it in GitHub Desktop.
Backup all Gists
#!/bin/bash
# Depends on git, curl, jq
BAK_DIR=$(date +"%y%m%d-%H%M")
GISTS_URL="https://api.github.com/users/$USER/gists?per_page=1000&access_token=$GITHUB_ACCESS_TOKEN"
mkdir "$BAK_DIR" && cd "$BAK_DIR" && curl -s "$GISTS_URL" | jq ".[] | .git_pull_url" | xargs -n1 git clone
@lindXdeep
Copy link

and restore ?

@ramn
Copy link
Author

ramn commented Feb 2, 2021

"Backup" as in exodus from gist.

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