Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@bparker06

This comment has been minimized.

Copy link
Owner Author

bparker06 commented Jun 20, 2019

Another method that doesn't use ruby:

curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | jq -rc '.[] | {clone_url} | .clone_url' | parallel -n 1 git clone {}

It will spawn one clone for every CPU thread you have, and wait until a thread is free before executing another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.