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

@harryisfish/gitt

v1.6.8

Published

A command-line tool to help you manage Git repositories and remote repositories, such as keeping in sync, pushing, pulling, etc.

Readme

Gitt

A command-line tool to delete local branches that have been deleted on the remote repository.

Installation

Using npm:

npm install -g @harryisfish/gitt

Using pnpm:

pnpm add -g @harryisfish/gitt

Usage

Basic Commands

# Default behavior (auto-clean deleted branches)
gitt

# Interactive mode (select branches to delete)
gitt -i
# or
gitt --interactive

# Dry run (preview what would be deleted)
gitt -d
# or
gitt --dry-run

# Check version
gitt -v
# or
gitt --version

# Show help
gitt -h
# or
gitt --help

Stale Branch Cleaning (NEW)

Clean up branches that haven't been updated for a long time:

# Find branches inactive for 90+ days (default)
gitt --stale

# Custom threshold (e.g., 30 days)
gitt --stale 30

# Preview stale branches without deleting
gitt --stale --dry-run

# Interactively select stale branches to delete
gitt --stale -i

Note: Stale branch detection:

  • Checks the last commit date on each branch
  • Automatically excludes the main branch
  • Protects branches in use by Git worktrees
  • Can be combined with interactive (-i) and dry-run (-d) modes

Features

🔄 Auto Update Notification

Gitt automatically checks for updates on each run and notifies you when a new version is available.

🌳 Worktree Protection

Branches currently checked out in Git worktrees are automatically protected from deletion to prevent errors.

🧹 Smart Branch Cleanup

  • Remote-deleted branches: Automatically detect and clean branches removed from remote
  • Stale branches: Find and remove branches inactive for X days
  • Merge status check: Safely handles both merged and unmerged branches
  • Interactive mode: Manual selection with clear indicators
  • Dry-run mode: Preview changes before applying

🛡️ Branch Protection

  • Honors .gitt ignore patterns
  • Respects Git worktree usage
  • Never touches the main branch

Configuration

Main Branch Detection

Gitt automatically detects your main branch in the following order:

  1. .gitt configuration file (Project level)
  2. Git config gitt.mainBranch (User/System level)
  3. Remote HEAD (e.g., origin/HEAD)
  4. Common names (main, master)

Setting the Main Branch

You can explicitly set the main branch for your project using the command:

gitt set-main <branch-name>

Example:

gitt set-main master

gitt set-main master


This will create a `.gitt` file in your project root with your preference.

### Branch Protection

You can prevent specific branches from being deleted by adding them to the ignore list.

**Using command (Recommended):**
```bash
gitt ignore "release/*"
gitt ignore "test-branch"

Manual Configuration: You can also manually edit the .gitt configuration file:

{
  "mainBranch": "main",
  "ignoreBranches": [
    "release/*",
    "test-branch",
    "feature/important-*"
  ]
}

Supports glob patterns (e.g., *).

Documentation

FAQ

Q: What should I do when encountering "insufficient permissions" error?

A: Please ensure you have access permissions to the repository and have properly configured SSH keys or Git credentials.

Q: How to handle merge conflicts?

A: When merge conflicts occur, Gitt will prompt you to resolve them manually. After resolution, use gitt commit to continue and complete the merge operation.

Development

For detailed development guidelines, please refer to the Development Guide.

License

MIT


If you find this project helpful, please give it a star ⭐️