Skip to content

Instantly share code, notes, and snippets.

@abackstrom
Created June 25, 2015 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abackstrom/b8ecd3c02ebeee8636c8 to your computer and use it in GitHub Desktop.
Save abackstrom/b8ecd3c02ebeee8636c8 to your computer and use it in GitHub Desktop.
# get page # of 'last' page
curl -si https://github.<yourdomain>.com/api/v3/users/abackstrom/gists?access_token=$TOKEN | grep ^Link:
# download json metadata for all gists. use the right page range! curl expands the bracketed range
curl "https://github.<yourdomain>.com/api/v3/users/abackstrom/gists?access_token=$TOKEN&page=[1-27]" -o gists_#1.json
# clone all the repos
# install jq first. http://stedolan.github.io/jq/
jq -r '.[] | .git_pull_url' *.json | while read repo ; do git clone $repo ; done
# later, update all the repos
find . -type d -mindepth 1 -maxdepth 1 | while read repo ; do ( cd $repo && git rpull ) ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment