Skip to main content

TUI tool for browsing and bulk-deleting git branches

Project description

Git Cleaner — TUI for browsing and bulk-deleting git branches

Interactively browse, filter, and bulk-delete git branches from a fast terminal UI.

PyPI Python 3.11+ Textual 8.x MIT License


Install

uv tool install git-cleaner-tui
git-cleaner-tui

Or from source:

git clone https://github.com/Allentgt/Git-Cleaner
cd git-cleaner
uv sync
uv run git-cleaner-tui --repo /path/to/repo

Requires Python ≥ 3.11, uv (or pip), and a git repository.


Features

Feature Details
🌳 Tree view Branches grouped by prefix (feature/, bugfix/, …) with ahead/behind tracking
📅 Date filtering Calendar picker or presets: 7d, 30d, 90d, 1y
🛡️ Protection main/master/develop + custom patterns; cannot be selected
Blacklist Wildcard patterns (archive/*); hidden by default
☁️ Remote deletion Toggle r to also git push origin --delete
🧪 Dry run Preview deletions without executing
↩️ Undo Press u to restore the last batch via reflog
📥 Export Download filtered branch list as CSV or JSON
🔧 Maintenance GC, Repack, Prune, Reflog expiry — one click
📦 Stash browser List, drop, apply, pop stashes
🔖 Bookmarks Ctrl+B to save and switch between repos
Fast Single git for-each-ref call; bulk delete with one confirm

Keybindings

Key Action
Space Toggle branch selection
a Select / deselect all
d Delete selected (with confirmation)
r Toggle remote deletion
p Toggle protected visibility
b Toggle blacklisted visibility
u Undo last deletion batch
Ctrl+R Refresh
Ctrl+B Open bookmarks

Configuration

~/.git-branch-cleaner.toml (global) or .git-branch-cleaner.toml (per-repo):

[protected]
patterns = ["release/*", "hotfix/*"]

[blacklist]
patterns = ["archive/*", "wip-*"]

[theme]
name = "textual-dark"

Hardcoded defaults (always active): main, master, develop. The checked-out branch is also protected.


Development

git clone https://github.com/Allentgt/Git-Cleaner
cd git-cleaner
uv sync --dev
uv run pytest
uv run git-cleaner-tui

FAQ

Can I undo a deletion?

Yes — press u immediately after deleting. Undo uses git branch <name> <hash> via the stored commit hash.

Does it work on Windows?

Yes. Tested on Windows, macOS, and Linux. Python 3.11+.

How are dates filtered?

By the commit date of the branch tip. Both From and Until are inclusive.

Does the maintenance dashboard modify my repo?

It runs real git commands that modify .git. They don't change working tree files.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_cleaner_tui-1.6.0.tar.gz (75.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_cleaner_tui-1.6.0-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file git_cleaner_tui-1.6.0.tar.gz.

File metadata

  • Download URL: git_cleaner_tui-1.6.0.tar.gz
  • Upload date:
  • Size: 75.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for git_cleaner_tui-1.6.0.tar.gz
Algorithm Hash digest
SHA256 8d67ba395a02811ec95502d256fd8425242baaec145a275a379cc182762db794
MD5 701d0bde7603f04cbe74a66de40e1bc2
BLAKE2b-256 03d9cc4641154555521e8c603c39eaf54bb517be3f50f2f0103b4450328782df

See more details on using hashes here.

File details

Details for the file git_cleaner_tui-1.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for git_cleaner_tui-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca766159880197664ac22ab63f4fec00f1370820e664336485adab3331ce11d1
MD5 214938c4cedd62a9f6c08b6388e811a7
BLAKE2b-256 c7134c5f56bc971f7f4a70508a8d481a41c2d72fcacb14cfd6d36e504e7e52c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page