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

oh-my-git

v0.0.4

Published

A simple CLI tool to clean up local Git branches whose remote counterparts have been deleted.

Readme

oh-my-git 🧹

omg-cleanup (published as oh-my-git on npm) is a simple and powerful interactive command-line tool to help you keep your local Git repository tidy. It finds local branches whose upstream (remote) branch has been deleted and guides you through deleting them, one by one.

⚠️ Disclaimer

Use this tool at your own risk. It is designed to delete local branches, which is a destructive action. Always ensure you have a backup or that your work is pushed to a remote repository before running deletion commands. The tool cannot protect you from yourself.

✨ Features

  • Finds Stale Branches: Automatically identifies local branches whose remote tracking branch has been deleted (the ones that show [gone] in git branch -vv).
  • Always Interactive: Presents you with a clear checklist of stale branches to delete. You are always in control.
  • Fetches First: Runs git fetch --prune at the start to ensure your remote tracking information is up-to-date.
  • Safe by Default: First attempts a safe delete (git branch -d). If a branch has unmerged changes, it will ask for confirmation before offering to force delete it (git branch -D).
  • Protects Core Branches: Automatically prevents common branches like main, master, develop, etc. from being deleted. You can customize this list (see below).
  • Dry Run Mode: Use the --dry-run flag to preview which branches would be deleted, without actually deleting anything.
  • Custom Protected Branches: You can create a .git-cleanup-config.json file in your repo root to specify additional protected branches:
{
  "protectedBranches": ["main", "master", "develop", "release", "my-important-branch"]
}

⚙️ Installation

You can install oh-my-git (the package name) either locally within a project or globally on your system.

Local Installation (Recommended)

Installing it as a development dependency ensures that everyone on your team uses the same version.

Using npm:

npm install --save-dev oh-my-git

Using yarn:

yarn add --dev oh-my-git

Global Installation

A global installation allows you to run omg-cleanup from any repository on your machine.

Using npm:

npm install --global oh-my-git

Using yarn:

yarn global add oh-my-git

🚀 Setup & Usage

1. Configure package.json (Optional)

Add a script to your package.json to easily run omg-cleanup. Since the tool is fully interactive, you only need one simple command.

Open your package.json and add a new script to the scripts object:

{
  "name": "my-awesome-project",
  "version": "1.0.0",
  "scripts": {
    "omg:cleanup": "omg-cleanup"
  }
}

2. Run the Tool

Now you can execute the script from your terminal. The tool will guide you through the rest of the process.

Using npm:

npm run omg:cleanup

Using yarn:

yarn omg:cleanup

Global Usage

If you installed the tool globally, you can run it directly in any Git repository:

omg-cleanup

Optional: Dry Run

To see what would be deleted without actually deleting anything, use:

omg-cleanup --dry-run

The tool will then start its interactive session.

🤝 Contributing

This is an open-source project, and contributions are highly welcome! If you have ideas for improvements or find a bug, please don't hesitate to get involved.

Feel free to:

  • Open an Issue: To report a bug, suggest a feature, or ask a question.
  • Submit a Pull Request: If you want to contribute code, please open an issue first to discuss the proposed changes. This helps us coordinate our efforts.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.