Bulk remove repos

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?

1 Like

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.


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

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.


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.

Is there a better solution for this yet? Would be nice if students could maintain access to their old repositories for reference if they want, but I can’t go through and ask each one individually.

Hi @kescobo

Your request seems a bit off-topic here as the OP was actually asking to remove the repos in bulk.

However, to address your aim, you either don’t remove the repos or prepare the assignment so that the student will be admin of the repo. This way, the student can decide to transfer the repo to his own account at the end of the process and even make it public. The latter might have unintended effects though.

Fair enough - my ultimate goal is to bulk remove them from the org, but a requirement to delete the assignment and all related repos seems to have a number of ancillary effects as well.

© 2017 GitHub, Inc.
with by
GitHub Education