Skip to content

Instantly share code, notes, and snippets.

@debo
Last active December 5, 2022 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debo/c1fd192778c634055f8c29105072d0a3 to your computer and use it in GitHub Desktop.
Save debo/c1fd192778c634055f8c29105072d0a3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
GITHUB_BASE_URL="https://api.github.com"
GITHUB_ORGANIZATION="${PWD##*/}"
GITHUB_API_TOKEN=""
for repo in `curl -H "Authorization: Bearer $GITHUB_API_TOKEN" "$GITHUB_BASE_URL/orgs/$GITHUB_ORGANIZATION/repos?per_page=100" | jq '.[] | select( .archived == false ) | .ssh_url' | sed 's/"//g' | sed 's/null//g' | sed '/^\s*$/d' | sort`; do
git clone $repo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment