Last active
September 7, 2024 22:01
-
-
Save bjuretko/3d73a8cee8c262bf65fdb61d9822e06e 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