Skip to content

Instantly share code, notes, and snippets.

@rus-mihai
Created October 27, 2015 15:49
Show Gist options
  • Save rus-mihai/427b20c7f2d946959e72 to your computer and use it in GitHub Desktop.
Save rus-mihai/427b20c7f2d946959e72 to your computer and use it in GitHub Desktop.
clone all repos from a user from bitbucket while logging in with ssh
#Usage: getAllRepos.sh [username] [userwithrepos]
curl -u ${1} https://api.bitbucket.org/1.0/users/${2} > repoinfo
for repo_name in `grep -o \"slug[^,]*\" repoinfo | cut -f2 -d: | sed 's/\"//g'`
do
echo $repo_name
git clone ssh://git@bitbucket.org/${2}/$repo_name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment