Skip to content

Instantly share code, notes, and snippets.

@sohayb
Created December 14, 2015 15:27
Show Gist options
  • Save sohayb/5410f03f0a2d95f4cfb2 to your computer and use it in GitHub Desktop.
Save sohayb/5410f03f0a2d95f4cfb2 to your computer and use it in GitHub Desktop.
Clone all git repos from bitbucket. It can be modified easily to clone mercurial repos
#!/bin/bash
#Script to get all repositories under a user from bitbucket
#Usage: getAllRepos.sh [username] [password]
curl --user ${1}:${2} https://api.bitbucket.org/1.0/users/${1} > repoinfo
for repo_name in `grep \"name\" repoinfo | cut -f4 -d\"`
do
git clone https://${1}@bitbucket.org/${1}/$repo_name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment