Created
October 4, 2019 03:57
-
-
Save anuragmathur1/5007eabf37d8b374b49b775622432841 to your computer and use it in GitHub Desktop.
Pull all gitlab repos from the group
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
GITLAB_GROUP="<group-name>" | |
GITLAB_PRIVATE_TOKEN="<token>" | |
GITLAB_ADDRESS="gitlab.<name>" | |
for i in `curl -s "https://$GITLAB_ADDRESS/api/v4/groups/$GITLAB_GROUP/projects?private_token=$GITLAB_PRIVATE_TOKEN&per_page=999" | \ | |
grep -o "\"ssh_url_to_repo\":[^ ,]\+" | \ | |
awk -F ':' '{gsub(/"/, "", $2); gsub(/"/, "", $3); print $2":"$3}'`; do git clone $i; done | |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment