Skip to content

jakiyaa/Delete-Multiple-Repositories

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

🗑️ Delete-Multiple-Repositories

📖 A clear guide to delete multiple repositories at once.

🌟 Features

  • Automates the deletion of multiple repositories.
  • Works with both public and private repositories.

🛠️ Getting Started

Prerequisites

1️⃣ A GitHub Personal Access Token with the required permissions

🔑 Generate a Personal Access Token

To use the script, you’ll need a GitHub Personal Access Token. Follow these steps:

  1. Go to your GitHub settings.
  2. Click Generate new token.
  3. Select the scopes:
    • repo (for private repositories).
    • delete_repo (to enable repository deletion).
  4. Generate and copy the token. Store it securely, as you won’t be able to see it again!

2️⃣ Python 3.x installed on your computer

Ensure Python is installed to run the scripts.


⚡ How to Use

Python Script

Follow these steps to automate the deletion of multiple GitHub repositories:


1️⃣ Install Dependencies

Install the required Python library using pip:

pip install requests

2️⃣ Prepare the Script

Edit the bulk_delete.py script to include:

  • Your repository names.
  • Your personal access token.

For example, update the repos_to_delete.txt file as follows:

repo-name-1
repo-name-2
repo-name-3

3️⃣ Run the Script

Run the script in your terminal:

python bulk_delete.py

The script will loop through the specified repositories and delete them using the GitHub API.


⚠️ Important Notes

  • Double-check the repos_to_delete list to avoid accidental deletions.
  • Deleted repositories cannot be recovered, so ensure you've backed up any important data.
  • If you encounter issues, ensure your personal access token has the correct permissions (delete_repo).

About

easily remove many GitHub repositories at once using the GitHub API

Topics

Resources

Stars

Watchers

Forks

Languages