Skip to content

Instantly share code, notes, and snippets.

@sammerry
Created July 6, 2020 17:34
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 sammerry/5ff56a9920e70d6a961a3671ad0dc19c to your computer and use it in GitHub Desktop.
Save sammerry/5ff56a9920e70d6a961a3671ad0dc19c to your computer and use it in GitHub Desktop.

Cloning An Org

Occasionally you may need to clone a full organization including hidden repositories. This bash one liner will allow a full clone in batches related to page size.

<api token>: Your git api token
<org name>: The name of the organization your cloning
curl -H "Authorization: token <api token>" -s https://api.github.com/orgs/<org name>/repos?per_page=200 \
| jq ".[].ssh_url" \
| sed -e 's/"//g' \
| xargs -L1 -n1 git clone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment