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.1.tar.gz (75.9 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.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: git_cleaner_tui-1.6.1.tar.gz
  • Upload date:
  • Size: 75.9 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.1.tar.gz
Algorithm Hash digest
SHA256 b6eb0ab012ce5b7e73a088c6d86b0091eb1c84597b0f0732f1702102ce7402c0
MD5 07e03e19c309830b2625129c178f4da0
BLAKE2b-256 79e198e64bb0c65aa48e8d0aefc349de47083bac211ff6e3fe48e94fac4cf3f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for git_cleaner_tui-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b13b06fdf2b26a251a8fed7741c3ad42142ab12fb5fc9abb5417ca7b628014f4
MD5 bc379c0f39557a6a58095fc4587d42bd
BLAKE2b-256 6598ac7d118be5eca03df548b5796173bc7d6b635d641c7e5622d901ccd0d4ce

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