Skip to content

Instantly share code, notes, and snippets.

@itsjavi
Last active August 30, 2022 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsjavi/9669aa18a2e93c845b7a6a1284033a3d to your computer and use it in GitHub Desktop.
Save itsjavi/9669aa18a2e93c845b7a6a1284033a3d to your computer and use it in GitHub Desktop.
Clone and delete all your gitlab repos
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;
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