Git Product home page Git Product logo

delete-github-forks's Introduction

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 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.

$ 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!.

$ 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

delete-github-forks's People

Contributors

akazhuo avatar dependabot[bot] avatar rafnixg avatar schulzh avatar yangshun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

delete-github-forks's Issues

Wow

Thank you! You just saved me so much time.

Unexpected token function error

I created a token with delete_repo and public_repo option. Then I added the token and my github username inside the quotes in the config.json file. But I'm getting this error message when I run node fetch-repos.js.

async function fetchRepos(url) {
      ^^^^^^^^

SyntaxError: Unexpected token function
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:138:18)
    at node.js:974:3

If it helps, I also saw this warning upon install.

โ””โ”€โ”ฌ [email protected] 
  โ”œโ”€โ”ฌ [email protected] 
  โ”‚ โ””โ”€โ”ฌ [email protected] 
  โ”‚   โ””โ”€โ”€ [email protected] 
  โ””โ”€โ”€ [email protected] 

npm WARN EPACKAGEJSON [email protected] No repository field.

Any ideas?

Dry run

Hi, Thank you very much for this amazing tool. It helped me delete 50+ forks in no time flat.

Could you please add a --dry-run option to the delete command?

Thanks,
Andre

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.