Nifty Branches
Safely clean up merged, squash-merged, gone and stale git branches, with a preview and one-click restore.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Why
After a few months every repo has dozens of old local branches. git branch --merged only finds some of them, because branches merged with squash and merge on GitHub or GitLab don't count as merged to git. Deleting by hand is tedious, and scripts that delete for you are scary.
Features



- See before you delete. Clean Up Branches lists every local branch with the reason it can go and when it was last touched:
merged: fully merged into the default branch
squash-merged: its changes landed on the default branch via squash and merge
remote branch deleted: its upstream was deleted (for example after the PR was merged)
stale: no commits for 90 days (configurable)
- Sensible suggestions. Merged, squash-merged and gone branches are pre-selected. Stale-only branches and branches with unpushed commits are listed but not ticked.
- Never touches what matters. The branch you're on, the default branch and protected branches (
main, master, develop, release/*, hotfix/* by default) are never offered.
- Undo, any time. An Undo button appears right after cleaning up, and Restore Deleted Branch brings back any branch deleted with Nifty Branches, at its exact commit.
- Up to date. Runs
git fetch --prune first, so branches deleted on the remote are detected.
- Also in the Source Control view's
… menu.
Nifty Branches only deletes local branches. It never deletes anything on your remote.
Commands
| Command |
What it does |
Nifty Branches: Clean Up Branches… |
Pick branches to delete, with reasons shown |
Nifty Branches: Restore Deleted Branch… |
Bring back a branch deleted with Nifty Branches |
Settings
| Setting |
Default |
What it does |
nifty.branches.protected |
main, master, develop, dev, trunk, release/*, hotfix/* |
Branches that are never offered (globs) |
nifty.branches.staleDays |
90 |
Days without commits before a branch is stale (0 = off) |
nifty.branches.fetchFirst |
true |
Run git fetch --prune before checking |
Install
- VS Code: search for "Nifty Branches" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Privacy
This extension collects no telemetry and needs no account. It only runs git locally (plus git fetch, which talks to your own remote).
- Nifty Git Graph: Git History & Branch Graph: See your git history as a graph: branches, merges and tags, commit details and diffs, and checkout, merge, rebase, cherry-pick and more from a right-click. No sign-in. (Open VSX)
- Nifty Git Links: Open in GitHub, GitLab & Bitbucket: Open or copy links to files, lines, commits and pull requests on GitHub, GitLab, Bitbucket, Azure DevOps and Gitea. (Open VSX)
- Nifty Beautify: Format HTML in PHP, Blade & Twig: Format HTML inside PHP, Blade, Twig, Jinja, Handlebars, ERB and Liquid templates without breaking the template tags. (Open VSX)
- Nifty C# Templates: New Class, Record & Namespace: New C# class, interface, record, enum, test and controller files with the right namespace, plus namespace syncing. (Open VSX)
- Nifty Data Viewer: CSV & Parquet Viewer with SQL: Open CSV, Parquet and JSON files as a fast table and query them with SQL, powered by DuckDB. Sort, page through millions of rows, and export to CSV, Parquet or JSON. (Open VSX)
- Nifty Docs: Dash, Zeal & DevDocs Lookup: Look up the word under the cursor in Dash, Zeal or DevDocs, with docsets picked from your language and frameworks. (Open VSX)
See all 28 Nifty tools at https://getnifty.dev
| |