Forked from bjuretko/github_clone_all_repos_of_org.sh
Created
September 7, 2024 22:01
-
-
Save hetzge/8b6c34b0e73a3ea6491bdf16aaab4a74 to your computer and use it in GitHub Desktop.
Checkout all repos from an Organization/Group on GitHub / GitLab
This file contains hidden or 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
| curl -Ss -u <username> --header "X-GitHub-OTP: <OTP from your SMS or App>" https://api.github.com/orgs/<orgname>/repos | \ | |
| jq -a -r ".[].ssh_url" | \ | |
| xargs -I "{}" git clone "{}"` |
This file contains hidden or 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
| # Checkout all repositories of a gitlab group | |
| # Project urls are stored in a project json structure under names `ssh_url_to_repo` and `http_url_to_repo`. | |
| # You need a personal accesstoken (PAT) https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html | |
| curl --header "Private-Token: <PAT>" https://gitlab.com/api/v4/groups/<groupname>/projects?per_page=100 | \ | |
| jq -a -M -r .[].ssh_url_to_repo | \ | |
| xargs -I "{}" git clone "{}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment