
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
git-branch-trimmer
Advanced tools

A CLI tool to detect and remove stale local Git branches from your repository.
This tool analyzes your Git branches and helps you identify which ones can be safely deleted, based on whether they have remote counterparts and how long it's been since their last commit.
Install globally using your preferred package manager:
# npm
npm install -g git-branch-trimmer
# pnpm
pnpm add -g git-branch-trimmer
Run in any Git repository:
git-branch-trimmer
Optional flags:
# Custom stale threshold in days (default: 30)
git-branch-trimmer --stale-threshold 60
# Dry run mode
git-branch-trimmer --dry-run
# Skip confirmation prompt
git-branch-trimmer --force
What it does:
| Option | Description |
|---|---|
-t, --stale-threshold <days> | Set the threshold in days for a branch to be considered stale (default: 30) |
-d, --dry-run | Show what would be deleted without actually deleting |
-f, --force | Skip confirmation prompt |
FAQs
CLI tool to detect and remove stale Git branches
We found that git-branch-trimmer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.