Skip to content

Instantly share code, notes, and snippets.

@RicardoRagel
Last active August 17, 2022 11:21
Show Gist options
  • Save RicardoRagel/08351112b84bb3fd907fc41aad9a3098 to your computer and use it in GitHub Desktop.
Save RicardoRagel/08351112b84bb3fd907fc41aad9a3098 to your computer and use it in GitHub Desktop.
Simple script to clone all the repositories of a Github Organization
# Before execute this script, please make sure:
# - You have a Personal Access Token with, at least, read:org permissions
# - You have the module gh installed: $ sudo snap install gh
# - You have already logged into gh using: $ gh auth login
# Note: select HTTPS or change the proper script command
# - Modify <CHANGE_ME> to your organization name as it's shown in Github
MY_ORG_NAME=<CHANGE_ME>
gh repo list ${MY_ORG_NAME} --limit 1000 | while read -r repo _; do
#gh repo clone "$repo" "$repo"
git clone "https://github.com/$repo"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment