Skip to content

Instantly share code, notes, and snippets.

@ashishmohite
Created April 24, 2018 11:46
Show Gist options
  • Select an option

  • Save ashishmohite/15603234a1412937f7559530fb4783e5 to your computer and use it in GitHub Desktop.

Select an option

Save ashishmohite/15603234a1412937f7559530fb4783e5 to your computer and use it in GitHub Desktop.
How to clone all the repos in the github org
# for hosted enterprize git server
curl -H 'Authorization: token <secret_token>' 'https://[HOST]/api/v3/orgs/[ORG]/repos' | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
#for github
curl -H 'Authorization: token <secret_token>' 'https://api.github.com/orgs/[ORG]/repos' | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment