Skip to content

Instantly share code, notes, and snippets.

@anuragmathur1
Created October 4, 2019 03:57
Show Gist options
  • Save anuragmathur1/5007eabf37d8b374b49b775622432841 to your computer and use it in GitHub Desktop.
Save anuragmathur1/5007eabf37d8b374b49b775622432841 to your computer and use it in GitHub Desktop.
Pull all gitlab repos from the group
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&amp;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