Skip to content

Instantly share code, notes, and snippets.

@hazcod
Created November 28, 2019 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hazcod/3e8f7ac1c2b1d9f96f508617218fa8aa to your computer and use it in GitHub Desktop.
Save hazcod/3e8f7ac1c2b1d9f96f508617218fa8aa to your computer and use it in GitHub Desktop.
Clone all your organization repositories on GitHub.
#!/usr/bin/env bash
# will ask for your personal access token
GH_USER=""
GH_ORG=""
curl -u "${GH_USERNAME}" -s "https://api.github.com/orgs/${GH_ORG}/repos?per_page=200" | 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