Skip to content

Instantly share code, notes, and snippets.

@aterreno
Created January 6, 2021 09:46
Show Gist options
  • Save aterreno/db40c21de964ec8dee16f55e9fa95012 to your computer and use it in GitHub Desktop.
Save aterreno/db40c21de964ec8dee16f55e9fa95012 to your computer and use it in GitHub Desktop.
Clones all repos in an org, needs an auth token
function cloner {
curl -H "Authorization: token $1" -s "https://api.github.com/orgs/$2/repos?per_page=1000" \
| sed -n '/"ssh_url"/s/.*ssh_url": "\([^"]*\).*/\1/p' \
| sort -u \
| xargs -n1 git clone;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment