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

commit-delete

v1.0.1

Published

Reset the Git history of a repository while keeping the current files intact.

Readme

Commit-delete

Reset the Git history of a repository while keeping the current files intact.

Commit-delete is a lightweight, dependency-free Node.js CLI tool that replaces the entire Git history of the current repository with a single initial release commit and force-pushes the result to origin/master.

⚠️ WARNING: This tool is destructive. It permanently deletes the existing Git history of the repository and force-pushes the new history. Other users working on the repository may need to re-clone or reset their local copy.

Usage

cd my-project
commit-delete

The CLI:

  1. Verifies Git is installed.
  2. Verifies the current directory is a Git repository.
  3. Shows the repository information (path, branch, remote, remote URL, commit count).
  4. In an interactive terminal, lets you pick the target branch, remote and commit message.
  5. Shows a clear warning and a configuration preview.
  6. Asks for confirmation — No is the default.
  7. On confirmation, executes:
git checkout --orphan latest_branch
git add -A
git commit -am "<message>"
git branch -D <old-branch>
git branch -M <target-branch>
git push -f <remote> <target-branch>

Options

| Flag | Description | |------|-------------| | -b, --branch <name> | Target branch (default: current branch) | | -r, --remote <name> | Remote to push to (default: origin) | | -m, --message <text> | Commit message (default: initial release) | | -y, --yes | Skip the confirmation prompt | | -n, --dry-run | Show the commands without executing them | | -h, --help | Show this help |

When stdin is not a terminal (for example in scripts or CI), the branch, remote and commit message default to the current branch, origin and initial release, and can be overridden with the flags above.

Installation

Globally via npm

npm install -g commit-delete

From source

npm install
npm link
commit-delete

Development

npm test

Tests create temporary Git repositories (including a bare remote) and verify the full flow end-to-end.

How it works

Before the operation:

commit A
   ↓
commit B
   ↓
commit C

After commit-delete:

initial release

The current files are preserved. Only the history is rewritten.

Requirements

  • Node.js 18+
  • Git
  • A valid Git repository
  • A remote to push to (default origin)
  • Permission to force-push to the remote

Error handling

Every Git command is checked for failure. If a command fails, Commit-delete stops, shows the failed command and the Git error, and exits with a non-zero exit code.

If the local history was rewritten but the remote push fails (for example when origin is missing or push permission is denied), the CLI clearly states that the local repository is using the new history and that the push must be done manually.

Safety

  • The tool never initializes a Git repository automatically.
  • It never deletes project files.
  • It never asks for Git credentials — authentication is left to Git itself.
  • The confirmation happens before any repository state is changed.

License

MIT