Mass deleting github repos

can repos get deleted with redact in bulk?

redact mass deletes comments, stars, follows, and gists. if you want to delete your repos read this guide.

2 Likes

If you’re trying to wipe a bunch fast, you’ve got a few real options:

  • Archive instead (way safer) makes them basically “gone” from view but you can undo it if you panic later lol

  • GitHub CLI: easiest way to bulk manage stuff without clicking 200 times

  • API script: if you want rules like “delete everything with prefix test-” or “older than 2022” or whatever

Before you go full send:

  • if any of these are org repos you might not even have permission or the org can block deletes

  • maybe do an archive pass first and then wait a day then delete once you’re sure you didn’t just yeet something important

1 Like

you ever heard of repo reaper? I’ve never used it but have heard good things about it, it’s made specifically to remove repos in bulk: https://reporeaper-frontend.onrender.com/

it was just released in Aug of 25’, so not much feedback about it yet. if you decide to use it report back on how you like it, I am curious.

1 Like

doesnt github allow for mass repo delting, like as a native feature within github admin? I believe they do. although, the fact someone made repo reaper maybe points to the contrary. I don’t know, I’m not a big github user.

No, @D-Mag is wrong actually. There are no mass delete options within github, you gotta use a 3rd party app.

I have personally used https://reposweeper.com/ and it worked as intended. They also have repo reaper, linked up above in trigger’s post.

Read this: Bulk delete github repos ¡ GitHub

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ’ |.*’ and replace by empty.

  5. Register a new personal access token with a ‘delete_repo perm’ https://github.com/settings/tokens/new

  6. Copy the access_token and run the following line replacing xxx with your access token.

Linux and OS X :

while read r;do curl -XDELETE -H 'Authorization: token xxx' "https://api.github.com/repos/$r ";done < repos

Windows:

get-content D:\repolist.txt | ForEach-Object { Invoke-WebRequest -Uri https://api.github.com/repos/$_ -Method “DELETE” -Headers @{"Authorization"="token xxx"} }

Caution

I have only tested this script on Linux.

3 Likes

fyi there is also a browser extension for deleting the repos https://chromewebstore.google.com/detail/npleadnddajjokllpjmpkekijopogeci?utm_source=item-share-cb

5 Likes

I’ve used that browser extension, it does what it says it does.

1 Like

Pretty sure Redact can’t bulk delete repos atm, it mainly handles stuff like stars, follows, comments, and gists.

If you’re trying to wipe a bunch of repos without 200 clicks, the least painful route is the GitHub CLI (gh) or the API. I’d honestly do a quick “archive everything” pass first then sleep on it and only delete if you’re 100% sure you’re not about to wipe something important that you’ll regret.

GitHub really said “sure you can delete it… just type the repo name like you mean it” for every single one.

If you’re doing a purge, the low-regret move is: make them private + archive first instant profile cleanup, then batch-delete later with the GitHub CLI once you’re positive you’re not deleting the one repo that still has your SSH config from 2019.

Like other users have already mentioned, we don’t currently support repo deletion. Just likes, comments, stars, follows and gists. All the info on our deletion service for Github is here: Mass Delete Comments, Stars, Follows, & Gists in Github | Redact

1 Like