
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
git-branch-cleanup
Advanced tools
A Node.js CLI tool to help clean up your local Git branches that have no active upstream branch or whose upstream branch is gone.
A Node.js CLI tool to help clean up your local Git branches that have no active upstream branch or whose upstream branch is gone. This script assists in removing stale local branches while protecting your default branch (e.g., main or master).
WARNING Branches deleted locally cannot be recovered. If you have any local unsaved work that has not been pushed to a remote repository, IT WILL BE LOST. Use this tool at your own risk. The maintainers assume no responsibility for any data loss. Always review the branches marked for deletion before confirming the cleanup process.
Detects Stale Branches:
Identifies branches that either have no upstream branch or have an upstream branch marked as gone (for example, after a PR is merged and the remote branch is deleted).
Default Branch Detection:
Checks for the existence of local main and/or master branches. If both exist, you will be prompted to select which one you use as your default.
Pre-Cleanup Check:
Before performing any cleanup, if you are not currently on your default branch, you’ll be asked whether you’d like to switch to it or have your current branch excluded from cleanup.
Safe and Forced Deletion Options:
git branch -d and warns if a branch is not fully merged.git branch -D to remove branches that couldn’t be safely deleted.Flexible Cleanup Choices:
Choose to delete all stale branches, force-delete them, or delete all except your default branch.
This CLI tool is published on NPM and can be run directly using NPX. Make sure you have Node.js installed.
Run the following command from the root of any Git repository (i.e., a folder containing a .git directory):
npx git-branch-cleanup
FAQs
A Node.js CLI tool to help clean up your local Git branches that have no active upstream branch or whose upstream branch is gone.
We found that git-branch-cleanup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.