Skip to content

Instantly share code, notes, and snippets.

@toddlucas
Created February 1, 2020 21:49
Show Gist options
  • Save toddlucas/0e04d60154e9a71d479a1ad2c565b62c to your computer and use it in GitHub Desktop.
Save toddlucas/0e04d60154e9a71d479a1ad2c565b62c 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