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

gitrewrite

v0.1.0

Published

Edit Git history vidir style

Downloads

15

Readme

gitrewrite

Edit Git history vidir style.

Install

bun --global add gitrewrite
bunx gitrewrite

npm install -g gitrewrite
npx gitrewrite

Requirements

  • git and Node.js 18+
  • an attached branch head; detached HEAD is not supported

How It Works

  1. gitrewrite selects a first-parent suffix ending at HEAD
  2. writes that selection to a temporary history.yaml
  3. opens the YAML buffer in $EDITOR
  4. gitrewrite validates the edited YAML and prints a simulated rewrite
  5. it prompts before applying unless you pass --yes or --no-verify

Quick Start

gitrewrite
gitrewrite --last 5
gitrewrite --all
gitrewrite HEAD~10..HEAD
gitrewrite HEAD~10 --dry-run
gitrewrite --last 1 --yes

By default, gitrewrite selects the last 50 first-parent commits ending at HEAD.

Edited Buffer

The editor buffer is YAML. Each entry contains the commit identity and message fields that gitrewrite can rewrite:

- sha: 0123456789abcdef
  subject: third
  author:
    name: Test User
    email: [email protected]
  committer:
    name: Test User
    email: [email protected]
  date: 2026-02-22 01:23:45
  body: |
    body

You can:

  • change subject, body, author, committer, or date
  • reorder entries to replay commits in a different order
  • remove entries to drop commits from the selected range

Selection Rules

  • gitrewrite only edits a contiguous first-parent suffix ending at HEAD
  • --last N and --all are mutually exclusive
  • [revision] cannot be combined with --last or --all
  • a single revision like HEAD~10 is treated as HEAD~10..HEAD

Flags

  • --last N edit the last N first-parent commits ending at HEAD
  • --all edit the full first-parent history ending at HEAD
  • --dry-run preview the rewrite without applying it
  • --no-verify skip the confirmation prompt after validation
  • --yes apply without the confirmation prompt

Notes

  • Reordering or dropping merge commits is not supported. Merge commits can still be edited for metadata changes.
  • If the edited YAML is semantically unchanged, gitrewrite exits cleanly without rewriting history.
  • If the working tree is dirty, gitrewrite preserves those tracked changes and updates the branch ref without checking out the rewritten tree.
  • Rewritten history still needs the usual force-push workflow if you have already published those commits.

Safer Workflow

Use --dry-run first when you are changing commit order or dropping commits:

gitrewrite --last 5 --dry-run

That prints the planned changes, the Git operations, and the simulated selected history without mutating the branch.