Last active
August 30, 2022 08:14
-
-
Save itsjavi/9669aa18a2e93c845b7a6a1284033a3d to your computer and use it in GitHub Desktop.
Clone and delete all your gitlab repos
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
for repo in $(curl -s --header "PRIVATE-TOKEN: YOUR_PERSONAL_ACCESS_TOKEN" "https://gitlab.com/api/v4/projects/?simple=yes&private=true&owned=true&per_page=1000" | jq -r ".[].id"); | |
do curl -H "Content-Type: application/json" --header "PRIVATE-TOKEN: YOUR_PERSONAL_ACCESS_TOKEN" -X DELETE "https://gitlab.com/api/v4/projects/$repo"; | |
done; |
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
for repo in $(curl -s --header "PRIVATE-TOKEN: YOUR_PERSONAL_ACCESS_TOKEN" "https://gitlab.com/api/v4/projects/?simple=yes&private=true&owned=true&per_page=1000" | jq -r ".[].ssh_url_to_repo"); do git clone $repo; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment