Created
September 14, 2015 00:31
-
-
Save jsok/bc5fb8eab95535bc7e8d to your computer and use it in GitHub Desktop.
Clone all repositories of an organisation
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 | |
set -e | |
# Usage: | |
# ORG=MyOrg OAUTH_TOKEN=token ./clone.sh | |
SSH_FILTER=".[] | .ssh_url" | |
REPOS=$(curl -s -H "Authorization: token ${OAUTH_TOKEN}" https://api.github.com/orgs/$ORG/repos | jq -r "$SSH_FILTER") | |
for repo in $REPOS; do | |
echo "=> Cloning $repo..." | |
git clone $repo | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment