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-harvest

v0.1.20

Published

Clean up branches and worktrees

Readme

git-harvest

English | 日本語

Clean up branches and worktrees.

Run directly without installing

# bun
bunx git-harvest@latest

# pnpm
pnpx git-harvest@latest

# npm
npx -y git-harvest@latest

(Optional) Set up aliases

# bun
echo "alias ghv='bunx git-harvest@latest'" >> ~/.zshrc
echo "alias 'ghv!'='bunx git-harvest@latest --all'" >> ~/.zshrc

# pnpm
echo "alias ghv='pnpx git-harvest@latest'" >> ~/.zshrc
echo "alias 'ghv!'='pnpx git-harvest@latest --all'" >> ~/.zshrc

# npm
echo "alias ghv='npx -y git-harvest@latest'" >> ~/.zshrc
echo "alias 'ghv!'='npx -y git-harvest@latest --all'" >> ~/.zshrc

Install

Shell (macOS/Linux) (recommended)

curl -fsSL https://raw.githubusercontent.com/nozomiishii/git-harvest/main/install.sh | bash

Restart your terminal or run source ~/.zshrc to start using git-harvest.

Homebrew

brew install nozomiishii/tap/git-harvest

(Optional) Set up aliases

Set up aliases for quicker access. You can use both or just the one you prefer:

ghv / ghv!

# Shell alias
echo "alias ghv='git-harvest'" >> ~/.zshrc
echo "alias 'ghv!'='git-harvest --all'" >> ~/.zshrc

git harvest

# Git subcommand — run as `git harvest`
git config --global alias.harvest '!git-harvest'

Uninstall

curl -fsSL https://raw.githubusercontent.com/nozomiishii/git-harvest/main/uninstall.sh | bash

Usage

git-harvest

Options

git-harvest --help     # Show help
git-harvest --version  # Show version
git-harvest --dry-run  # Show what would be deleted without actually deleting
git-harvest --all      # Delete all branches and worktrees except the default branch
git-harvest logo       # Show the git-harvest logo

Recommended workflow

By combining with Git hooks' post-merge command, you can automatically harvest after every merge or pull.

With lefthook

There are many Git hook tools such as husky, pre-commit, and simple-git-hooks, but Lefthook is recommended because it is language-agnostic and easy to integrate into monorepos. Additionally, by using lefthook-local.yaml, you can run hooks only for yourself without affecting other team members.

# lefthook-local.yaml
post-merge:
  commands:
    git-harvest:
      run: npx -y git-harvest@latest
      # or: bunx git-harvest@latest
      # or: pnpx git-harvest@latest

What it does

Worktrees

| State | Display | Default | --all | |---|---|---|---| | Merged + clean | [DELETED] / [WILL DELETE] | Delete | Delete | | Merged + uncommitted changes | [GROWING] (uncommitted changes) | Keep | Delete | | Not merged | [GROWING] (not merged) | Keep | Delete | | No unique commits | [GROWING] (no unique commits) | Keep | Delete | | Main working tree | (not shown) | Keep | Keep |

Branches

| State | Display | Default | --all | |---|---|---|---| | Merged | [DELETED] / [WILL DELETE] | Delete | Delete | | Merged + checked out | [GROWING] (currently checked out) | Keep | Error | | Not merged | [GROWING] (not merged) | Keep | Delete | | No unique commits | [DELETED] / [WILL DELETE] | Delete | Delete | | Default branch | (not shown) | Keep | Keep |

--all exits with an error if a non-default branch is currently checked out. --dry-run --all shows all resources as [WILL DELETE] without errors.