Skip to content

Instantly share code, notes, and snippets.

@paulphys
Last active February 2, 2022 17:01
Show Gist options
  • Save paulphys/7c80a8b0ab6d683f84415da0fc450bec to your computer and use it in GitHub Desktop.
Save paulphys/7c80a8b0ab6d683f84415da0fc450bec to your computer and use it in GitHub Desktop.
git clone all of your starred repositories on github
#!/bin/bash
user="$1"
pages=$(curl -I https://api.github.com/users/$user/starred | sed -nr 's/^link:.*page=([0-9]+).*/\1/p')
for page in $(seq 1 $pages); do
curl "https://api.github.com/users/$user/starred?page=$page&per_page=30" | jq -r '.[].html_url' |
while read rp; do
git clone $rp
done
done
@paulphys
Copy link
Author

paulphys commented Feb 2, 2022

run with ./getstars.sh username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment