Skip to content

Instantly share code, notes, and snippets.

@finesse-fingers
Created February 3, 2021 02:45
Show Gist options
  • Save finesse-fingers/aff8a21e60b8c40efadc02b1c7c6c0c8 to your computer and use it in GitHub Desktop.
Save finesse-fingers/aff8a21e60b8c40efadc02b1c7c6c0c8 to your computer and use it in GitHub Desktop.
A script to clone all repos in a github organisation
#!/bin/bash
# Substitute variables here
ORG_NAME="<ORG_NAME>"
GITHUB_INSTANCE="<GITHUB_INSTANCE>"
URL="https://${GITHUB_INSTANCE}/api/v3/orgs/${ORG_NAME}/repos"
curl ${URL} | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["clone_url"]} ]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment