Created
April 22, 2017 01:00
-
-
Save rhysburnie/02d627ae7e83c816270cd9974b760e9c to your computer and use it in GitHub Desktop.
backup (and optional delete) repositories
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 | |
USER=; | |
PAGE=1; | |
curl "https://api.github.com/users/$USER/repos?page=$PAGE&per_page=100" | | |
grep -e 'git_url*' | | |
cut -d \" -f 4 | | |
xargs -L1 git clone |
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 | |
# WARNING BACKUP FIRST | |
# === | |
# ALSO THIS TARGETS ALL | |
# === | |
# You need to get a token: | |
# https://github.com/settings/tokens/new | |
# with permission: delete_repo | |
DELETE_TOKEN=; | |
USER=; | |
PAGE=1; | |
curl "https://api.github.com/users/$USER/repos?page=$PAGE&per_page=100" | | |
grep -e '^ "url":' | | |
cut -d \" -f 4 | | |
xargs -L1 curl -X DELETE -H "Authorization: token $DELETE_TOKEN" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment