Deleting multiple repos via command line interface in the terminal using a script (for organizations); saving hours of time if you have a large supply of repos to delete. Note if you are doing this for an individual user profile, you will need to adjust the script slightly.
- Generate a fine-grained Personal Access Token ID ($PAT_ID)
- Request that the organization accept the token, review permissions
- Test for org-repo permissions, run in the terminal:
curl -H "Authorization: Bearer $PAT_ID" https://api.github.com/repos/<Organization-Name>/<repo-name>
- Download the
delete_multiple_repos.sh
file - Replace $PAT_ID with personal access token; or create a separate environment variable file
- Enable file by running
chmod +x delete_multiple_repos.sh
in the terminal - Run the file by running
./delete_multiple_repos.sh
in the terminal