Skip to content

Instantly share code, notes, and snippets.

@banunatina
Last active Dec 15, 2016
Embed
What would you like to do?
Batch Clone

This script will batch clone all repos retrieved from a RESOURCEURL into the current directory that you're in.

This will prompt you for your github password.

Example Resource URLS:

https://api.github.com/user/repos

https://api.github.com/orgs/[ORGNAME]/repos?page=[PAGENUMBER]

I recommend storing this as a zsh or bash alias (i.e batch-clone ($1)) where $1 is the RESOURCE URL

curl -u[USERNAMEHERE] -s [RESOURCEURL] | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["url"]} ]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment