Bulk remove repos


(Johan Kohlin) #1

Hi, Does anyone know how to delete all repos created via an assignment [ that has the word PASSED in the readme]?

I can find the repos by searching “in:readme passed”, but there are 65 of them so deleting them one by one is tedious work.

Some students still haven’t completed the assignment, so I don’t want to delete the entire assignment.

ps. what happens to all assignment repos when you delete an assignment?


(Ugo Pattacini) #2

Hi @Magistern

When you delete an assignment from within the dashboard, all the related repositories will be purged.
To delete lots of repositories without picking up one by one, you would need to write for example a snippet in Ruby that makes use of GitHub API.


(Johan Kohlin) #3

I see. Well, thank you for responding so quickly. I guess, I’ll have a look at that API then.


(Ugo Pattacini) #4

This is a simple script that queries the name of the repositories contained in a given organization.

You might find it a useful starting point.


(Taylorjayoung) #5

Or you could just go to RepoSweeper and enter your GitHub username and Auth Token. You can filter your repos by “forked” and then selected all the ones you want to save/delete. It’s a pretty simple, and more intuitive then running a shell script.