Last active
July 1, 2016 12:40
-
-
Save Baccata/19189c45fcb9988461b729d844fb0d6e to your computer and use it in GitHub Desktop.
Cloning all the repos under a user or team from bitbucket
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
#!/bin/bash | |
#Script to get all repositories under a user or team from bitbucket | |
#Usage: cloneAllBitbucket [username] [user_or_team] | |
curl -u ${1} https://api.bitbucket.org/1.0/users/${2} \ | |
| jsawk 'return this.repositories.map(function(item){return item.name;})' \ | |
| jsawk -n 'out(this)' \ | |
| sed -e 's/^"//' -e 's/"$//' > repos | |
for repo_name in `cat repos` | |
do | |
git clone ssh://[email protected]/${2}/$repo_name | |
done | |
#rm repos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From ShellCheck: