Created
June 25, 2015 03:02
-
-
Save abackstrom/b8ecd3c02ebeee8636c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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