Skip to content

Instantly share code, notes, and snippets.

@vavavr00m
Created February 22, 2016 17:18
Show Gist options
  • Select an option

  • Save vavavr00m/7efdbc764ca4524743bd to your computer and use it in GitHub Desktop.

Select an option

Save vavavr00m/7efdbc764ca4524743bd to your computer and use it in GitHub Desktop.
Backup starred GitHub repositories (https://gist.github.com/anonymous/aebb4a0639b0af2cfd88)
#!/bin/bash
user="CHANGEME"
pages=$(curl -I https://api.github.com/users/$user/starred | sed -nr 's/^Link:.*page=([0-9]+).*/\1/p')
for page in $(seq 0 $pages); do
curl "https://api.github.com/users/$user/starred?page=$page&per_page=100" | jq -r '.[].html_url' |
while read rp; do
git clone $rp
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment