Created
January 6, 2021 09:46
-
-
Save aterreno/db40c21de964ec8dee16f55e9fa95012 to your computer and use it in GitHub Desktop.
Clones all repos in an org, needs an auth token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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