Created
April 30, 2020 18:54
-
-
Save soberich/0b3fb069a950f3c2b408a588db93a6e5 to your computer and use it in GitHub Desktop.
Bulk clone repos in Bitbucket REST Api 2.0
This file contains hidden or 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
# prerequisites: `httpie`, `jq`, GNU's `parallel`. e.g. brew install <package> | |
# there is max 100 page length n pages where n is 100 length page. Execute one one by one (there is no way you'll get more than 100 times parallelization) | |
# in `.values[].links.clone[1].href` `1` is for SSH, where `0` would be for HTTPS. | |
http https://<user>:<pass>@api.bitbucket.org/2.0/repositories/<account_name> pagelen==100 page==<page_num> | jq -r '.values[].links.clone[1].href' | parallel git clone | |
# Voila it takes approx 1-2 minutes to clone a 100 repos. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment