Created
March 8, 2022 22:19
-
-
Save ixth/c8e0ef49b19c4fc3b4c16cca1fe98cfd to your computer and use it in GitHub Desktop.
Backup GitHub Repos
This file contains hidden or 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
PAGE=0 | |
while true; do | |
PAGE=$(($PAGE + 1)) | |
REPOS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/user/repos?visibility=all&page=$PAGE" | jq -r '.[].ssh_url') | |
if [ -z "$REPOS" ]; then | |
break; | |
fi | |
for REPO in $REPOS; do | |
git clone --no-checkout "$REPO" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment