Repo Purge

Prune git working copies and their GitHub repositories: one alphabetical list of every repo under a directory, a window and a keystroke-driven review CLI, and deletion locally, on GitHub, or both

About This Project

repo-purge is a tool for pruning git working copies and their GitHub repositories. It scans a configured root directory, flattens repositories nested inside topic folders into a single alphabetical list, and resolves each repository's origin remote against GitHub to report visibility, redirects, and whether the working copy holds uncommitted changes, unpushed commits, stashes, or untracked files. Two front ends share the same engine and safeguards: repo-purge, a PySide6 window with a sortable table, canned filters, and checkbox-driven deletion, and ghmaintainer, a terminal program offering a flat listing, a one-repository-at-a-time keystroke review, and a direct delete command.

The project is written in Python and uses gh, the GitHub CLI, for remote listing and deletion, gio for moving local deletions to the trash, and 1Password's op CLI as an optional source for a token carrying the delete_repo scope. Settings are stored per user in a TOML file, and every action is appended to a JSON audit log. Safeguards include deleting the remote before the local copy, refusing deletion outside the scan root, hiding nested repositories by default, refusing a both-delete on repositories that have no GitHub remote, and requiring a confirmation phrase that contains the item count. Decisions in review mode accumulate and are confirmed once at the end of the pass. The project is packaged as a Debian package that installs under /opt/repo-purge and can also be run directly from a checkout.

The tool suits developers and maintainers with many small or archived repositories scattered across folders who need to find out which ones exist only locally, which are safe to remove, and which consume the most disk space. It is most relevant to anyone managing a large personal or organisational collection of GitHub repositories on Linux who wants deletion to be deliberate and recoverable.

Project Details

Tags

clidebian-packagedeveloper-toolsgitgithubpyside6

Explore More Projects