Last active
July 21, 2023 13:46
-
-
Save ramn/226356dd66b9eaa4c079 to your computer and use it in GitHub Desktop.
Backup all Gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and restore ?