Bulk delete multiple old repositories and forks from your GitHub with a simple bash script and a valid personal access token with delete_repo scope.
You would need two packages installed for the script to work.
1. jq for transforming structured JSON data.
If you're on Debian or Ubuntu, you could simply use sudo apt-get install jq to proceed.
MacOS users can use Homebrew to install jq with brew install jq.
2. HTTPie for interaction with GitHub's RESTful API.
Just like jq, HTTPie is in the official Ubuntu and Debian repositories and can be installed using sudo apt-get install httpie.
MacOS users can install HTTPie using Homebrew with brew install httpie.
Generate a valid token to access GitHub API from your here. Select the delete_repo scope to allow the script to delete repositories.
Clone this repository using
git clone https://github.com/agamjolly/BulkRepoDelete.gitChange the directory to where the cloned repository is saved using
cd <path to file>Make the delete.sh file executable by running the following command
chmod +x delete.shUse the following command to execute the script
./delete.shAll repositories on your GitHub account would be gradually deleted.
Pull requests are welcome. For any further questions, feel free to reach out to me at me@agamjolly.com. Thank you!
MIT license can be found in the LICENSE file.
Created by Agam Jolly