Created
April 8, 2016 08:24
-
-
Save DanyC97/c3ea496a27ad01d755b75bed851eb752 to your computer and use it in GitHub Desktop.
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
To clone all repos from your organisation, try the following one-liner: | |
ORG=company; curl "https://api.github.com/orgs/$ORG/repos?per_page=1000" | grep -o 'git@[^"]*' | xargs -L1 git clone | |
For user repos, try: | |
USER=foo; curl "https://api.github.com/users/$USER/repos?per_page=1000" | grep -o 'git@[^"]*' | xargs -L1 git clone | |
If you need to clone the private repos, you've to insert your API key. Also check for hub tool which could probably help you with that. | |
Hints: | |
- To increase speed, set number of parallel processes by specifying -P parameter for xargs (-P4 = 4 processes). | |
- If you need to raise the GitHub limits, try authenticating by specifying your API key. | |
- Add --recursive to recurse into the registered submodules, and update any nested submodules within. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also try this: