DEV Community

RepoSweeper
RepoSweeper

Posted on

I Found a 2-Year-Old GitHub Feature Request and Built It

A few weeks ago I was browsing GitHub Discussions and found a thread from September 2023. A developer named Nathan had posted asking for a proper branch cleanup tool — filter by last commit age, see who touched what, bulk delete stale branches.

It had been sitting open for two years. The best official response was essentially "have you tried the Stale tab?" which still makes you click delete one branch at a time.

The scope of the problem

The Stack Overflow question "How do I remove all stale branches from GitHub?" has 40,000 views. The workaround most people land on looks like this:

git push origin --delete branch-name-1
git push origin --delete branch-name-2
# repeat 40 more times
Enter fullscreen mode Exit fullscreen mode

Or you write a script against the GitHub API, handle auth, pagination, and hope you don't accidentally nuke something active.

So I built built a modern version

I already had reposweeper.com — a free tool for bulk repo management (archive, delete, visibility, collaborators) which I built to address a similar GitHub limitation. Adding branch management felt like the obvious next step.

You open a repo, every branch is sorted by last commit date with the author and commit message right there, you select the ones you want gone, and delete them in one shot. Protected branches are flagged so you can't accidentally select them.

It's four steps:

  1. Select the repo you want to clean up
  2. Hit Manage Branches

  3. Select the stale branches

  4. Hit Delete

I also went back and replied to Nathan's original thread with the link. Two years is a long time to wait for a feature.

If you have suggestions or run into anything weird, drop a comment.

Top comments (0)