Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yangshun/delete-github-forks
🍴 Bulk delete your GitHub forks in two simple steps!
https://github.com/yangshun/delete-github-forks
delete forks github github-forks open-source
Last synced: 3 months ago
JSON representation
🍴 Bulk delete your GitHub forks in two simple steps!
- Host: GitHub
- URL: https://github.com/yangshun/delete-github-forks
- Owner: yangshun
- License: mit
- Created: 2017-09-29T04:37:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T00:41:32.000Z (8 months ago)
- Last Synced: 2024-07-29T16:37:59.229Z (3 months ago)
- Topics: delete, forks, github, github-forks, open-source
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 211
- Watchers: 6
- Forks: 36
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - yangshun/delete-github-forks - 🍴 Bulk delete your GitHub forks in two simple steps! (JavaScript)
README
# Delete GitHub Forks
Delete your forked GitHub repositories easily in two steps (takes less than 5 minutes).
## Motivation
Deleting GitHub repositories via the GitHub interface is a hassle; you have to enter your password followed by the name of the repository. This is not scalable if you contribute to open source a fair bit and have many forked repositories that you may not necessarily want to keep.
Using these scripts, you can fetch a list of your GitHub repositories and delete all the unwanted repositories in one go.
## Getting Started
Clone this repository.
```
$ npm install
$ cp src/config.json.example src/config.json
```Add your GitHub username and access token to `config.json`. To get the access token, go to [this page](https://github.com/settings/tokens/new) and create a token that has the following permissions: `public_repo` and `delete_repo`.
## Usage
Firstly, run the following command to fetch all your forked repositories.
```sh
$ npm run fetch # Writes to a src/repos.json file
```A JSON file, `src/repos.json` containing an array of your repositories will be written into the same directory. Manually inspect it and remove the forked repositories that you want to keep. **The repositories that remain inside `src/repos.json` will be deleted on the next command. It is an irreversible operation. Use with great caution!**.
```sh
$ npm run delete # Reads from src/repos.json and deletes the repos inside it.
```And all the repositories within `src/repos.json` will be deleted! It's that easy.
The scripts can be potentially modified to work on an organization's repositories as well just by changing the URLs. Pull requests to support this feature are welcome.
## License
MIT