Created
November 22, 2016 12:34
-
-
Save rossille/6b177a9f87d8aeda43e548c78908950b to your computer and use it in GitHub Desktop.
Clone all organisations repositories with: ./clone.sh <git user> <git password> <org>
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
#!/usr/bin/env bash | |
curl -u $1:$2 -s "https://api.github.com/orgs/$3/repos?per_page=50&page=1" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' | |
curl -u $1:$2 -s "https://api.github.com/orgs/$3/repos?per_page=50&page=2" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' | |
curl -u $1:$2 -s "https://api.github.com/orgs/$3/repos?per_page=50&page=3" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' | |
curl -u $1:$2 -s "https://api.github.com/orgs/$3/repos?per_page=50&page=4" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' | |
# add pages if you have more than 200 repos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment