Created
April 10, 2015 13:22
-
-
Save StefanScherer/8215213c94a78234f7d6 to your computer and use it in GitHub Desktop.
Get all repos from GitHub or 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 from bitbucket | |
# Usage: getAllBitBucketRepos.sh [username] | |
repos=$(curl -u ${1} https://api.bitbucket.org/1.0/users/${1} | jq ".repositories[].name" | sed -e 's/^"//' -e 's/"$//') | |
for repo_name in $repos | |
do | |
git clone git@bitbucket.org:${1}/$repo_name.git | |
done |
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 und a GitHub organization | |
# Usage: getAllGitHubOrgRepos.sh [username:password] [orgname] | |
repos=$(curl -u ${1} -s https://api.github.com/orgs/${2}/repos?per_page=200 | jq ".[].clone_url" | sed -e 's/^"//' -e 's/"$//') | |
for repo_name in $repos | |
do | |
echo $repo_name | |
git clone ${repo_name} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment