npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-merged

v1.0.1

Published

Find Git branches that have been merged into production/main branch

Readme

git-merged

🔍 Find Git branches that have been merged into your main/production branch.

A simple, fast CLI tool to identify branches that are safe to delete because they've already been merged into your target branch.

Installation

Install globally via npm:

npm install -g git-merged

Usage

Basic Usage

# Find remote branches merged into origin/main
git-merged

# Find branches merged into production
git-merged production

# Find branches merged into develop
git-merged develop

Options

git-merged [branch-name] [options]

Arguments:

  • branch-name - Target branch to check merges into (default: main)

Options:

  • -l, --local - Search local branches instead of remote
  • -r, --remote - Search remote branches (default)
  • -n, --no-file - Don't save to file, only display in console
  • -o, --output PATH - Custom output file path
  • --delete-remote - Delete found remote branches from origin
  • --delete-local - Delete found local branches
  • --skip-confirm - Delete without interactive confirmation
  • --author NAME - Only include branches whose last commit author contains NAME
  • -h, --help - Show help message

Examples

Find remote branches merged into origin/main

git-merged

Find local branches merged into develop

git-merged develop --local

Display results without saving to file

git-merged main --no-file

Save to custom location

git-merged main --output ~/reports/merged-branches.txt

Combined options

git-merged production --local --output ./report.txt

Delete merged remote branches

git-merged main --delete-remote

Delete merged local branches

git-merged main --delete-local

Delete both local and remote branches for one author

git-merged main --delete-remote --delete-local --author radimbig

Delete without confirmation

git-merged main --delete-remote --delete-local --skip-confirm

When deleting without --skip-confirm, the tool prints the branches and the exact commands that will be executed, then asks for confirmation:

confirm deleting:
branch1 merged 21.01.2025 into origin/main
branch2 merged 22.05.2026 into main

commands that will be executed
git push origin --delete branch1
git branch -d branch2

Output

The tool displays results grouped by author, showing:

  • Merge Date - When the branch was merged
  • Branch Name - Name of the merged branch
  • Commit ID - Short hash of the merge commit
  • Author - Who created the branch

Example output:

--- Branches Merged into 'origin/main' (Mode: remote) ---

=== Author: John Doe ===
Merge Date    Branch Name                      Commit ID
----------    -----------                      ---------
2024-02-10    feature/user-authentication      a1b2c3d
2024-02-08    bugfix/login-error              e4f5g6h

=== Author: Jane Smith ===
Merge Date    Branch Name                      Commit ID
----------    -----------                      ---------
2024-02-12    feature/dashboard-redesign       i7j8k9l

Requirements

  • Git must be installed and available in PATH
  • Must be run from within a Git repository
  • For remote mode, requires access to origin remote

How It Works

The tool:

  1. Fetches the latest data from remote (if in remote mode)
  2. Lists all branches merged into the target branch
  3. Identifies actual merge commits (excludes fast-forwards and squashes)
  4. Extracts merge date, author, and commit information
  5. Groups results by author and sorts by date

Notes

  • The tool only identifies branches merged via explicit merge commits
  • Fast-forwarded or squashed branches are excluded (their "merge date" cannot be reliably determined)
  • By default, results are saved to deletable_branches_report.txt in the current directory

Development

PowerShell Version

The original PowerShell version is still available as find-deletable-branches.ps1 for Windows users who prefer PowerShell.

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

Found a bug or have a feature request? Please open an issue on GitHub.