Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Git Prune ButtonNew to Visual Studio Code? Get it now.
Git Prune Button

Git Prune Button

Git Prune + Local

|
1 install
| (1) | Free
Adds a Prune command to the Source Control panel that runs git fetch --prune and cleans up local branches whose remote was deleted.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Git Prune Button

Adds a Prune command to the Source Control panel's ··· menu that runs git fetch --prune for the current repository, then offers to clean up local branches whose upstream was deleted.

Features

  • Prune in the Source Control ··· menu (both the panel title and per-repository menus) runs git fetch --prune against the repo you invoked it from.
  • Parses the pruned remote branches and cross-references them against your local branches' upstream tracking, then offers to delete the matching local branches (git branch -d).
  • If a branch can't be safely deleted (e.g. it was squash-merged, so git doesn't see it as fully merged), you're prompted with a Force Delete option (git branch -D) to remove it anyway.
  • Also available from the Command Palette as Prune (falls back to the first open repository).

Requirements

Git must be installed and available on your PATH.

Known Issues

None currently tracked.

Release Notes

0.0.1

Initial release: prune remote-tracking branches and clean up matching local branches, with an optional force-delete step for branches git can't verify as merged.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft