Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 gh-repo-cleaner

A simple and efficient Node.js script to delete multiple GitHub repositories at once while ensuring that specified repositories are protected from deletion.

✨ Features

  • Fetches all repositories from your GitHub account (handles pagination).
  • Excludes specific repositories from deletion using an escape list.
  • Deletes repositories sequentially to avoid hitting GitHub API rate limits.
  • Provides clear logs on which repositories were deleted and which failed.

📌 Prerequisites

🚀 Installation & Usage

1️⃣ Clone the repository

git clone https://github.com/emirxmertoglu/gh-repo-cleaner.git
cd gh-repo-cleaner

2️⃣ Install dependencies

Since this script only uses Axios, you can install it via:

yarn install

3️⃣ Configure your credentials

Open index.js and replace the placeholders:

const GITHUB_ACCESS_TOKEN = "your_personal_access_token";
const USERNAME = "your_github_username";
const ESCAPE_LIST = ["repo1", "repo2", "repo3"];

4️⃣ Run the script

node index.js

📌 Important Notes

  • This action is irreversible! Double-check the ESCAPE_LIST before running the script.
  • GitHub imposes rate limits on API requests. If you have too many repositories, you might hit these limits.

🤝 Contributing

Feel free to fork this repository and submit pull requests. Any contributions, whether fixing bugs, optimizing code, or adding features, are welcome!

🐟 License

This project is licensed under the MIT License.

📚 Sources

About

A Node.js script to bulk delete GitHub repositories while preserving selected ones.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages