Created
August 25, 2016 21:54
-
-
Save scottopell/b9f4a60d0a49fc90c62cd0b3abb2f56e to your computer and use it in GitHub Desktop.
Clone all user's repos on bitbucket
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
#!/bin/bash | |
# Script to clone all repositories under a user from bitbucket | |
# Usage: getAllRepos.sh [username] | |
repos=$(curl -u ${1} https://api.bitbucket.org/1.0/users/${1} | jq -r '.repositories[] | .slug') | |
vcs=git # or hg | |
for repo_name in $repos | |
do | |
echo -e "\tFetching $repo_name" | |
$vcs clone "ssh://[email protected]/${1}/$repo_name" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment