Skip to content

Instantly share code, notes, and snippets.

@bonelifer
Forked from toddlucas/github-backup.sh
Created September 3, 2020 19:42
Show Gist options
  • Save bonelifer/27146fe2b34072513f31a9c6ecdf25bc to your computer and use it in GitHub Desktop.
Save bonelifer/27146fe2b34072513f31a9c6ecdf25bc to your computer and use it in GitHub Desktop.
Back up GitHub repos
#!/bin/bash
USERNAME='xyz'
# https://news.ycombinator.com/item?id=22210681
for i in `seq 1 20`;
do
curl --fail -s https://api.github.com/users/$USERNAME/repos?page=$i | jq '.[] | .clone_url' | xargs -t -n1 git clone
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment