Skip to main content

Instantly reset Git history to a single fresh commit.

Project description

🚀 commits-nuke

Instantly collapse your entire Git history into a single, fresh initial commit.

commits-nuke is a CLI tool that wipes your local commit history while keeping your current files exactly as they are. It automates the git checkout --orphan process into a single, safe command.

📦 Installation

Recommended (uv)

uv tool install commits-nuke

Standard (pip)

pip install commits-nuke

⌨️ Usage

Run this command inside any local Git repository:

# Default: creates an "Initial commit"
commits-nuke

# Custom message:
commits-nuke "Clean start"

# Check version or help:
commits-nuke -v
commits-nuke -h

🤖 AI Agents & Automation (v2.0+)

Designed to be Model Context Protocol (MCP) and CI/CD friendly:

# Bypass safety prompts (for scripts/agents)
commits-nuke "Automated reset" -y

# Output strict JSON for AI parsing
commits-nuke "Agent reset" -y --json

Python API: You can bypass the CLI entirely in your Python scripts or MCP servers:

from nuke_tool.main import nuke_history

result = nuke_history("Programmatic reset")
print(result["success"]) # Returns True/False

Capabilities

  • Auto-Branch Detection: Detects your active branch (main, master, etc.) and replaces it seamlessly.
  • Agent-Ready: Native support for JSON output and prompt-bypassing for LLMs.
  • Safety Catch: Interactive y/N confirmation prevents accidental execution for humans.
  • Files Preserved: Your current working directory remains untouched; only history is purged.
  • Visual Feedback: Provides a dramatic ASCII confirmation upon success.
  • Zero Dependencies: Uses only Python standard libraries.

Execution Steps

  1. Identifies the active branch name.
  2. Creates a temporary orphan branch (no history).
  3. Stages all current files and creates a new root commit.
  4. Deletes the original branch and renames the orphan branch to match.

⚠️ Warning

This action is destructive. It permanently removes all previous local commits. Use only when you want to reset a repository's history to a "Day 1" state.

📜 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commits_nuke-2.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commits_nuke-2.0.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file commits_nuke-2.0.0.tar.gz.

File metadata

  • Download URL: commits_nuke-2.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for commits_nuke-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ceac4fbb2e542c0b6c9ed1630f5df7a65656bf5852c886c3987e7b3505796f86
MD5 6daff49fe5c3c0ecbf20235d323cbf13
BLAKE2b-256 99cc82834d4a2194a609671e3705d0e75cf7679d562752d467cac873f256228e

See more details on using hashes here.

Provenance

The following attestation bundles were made for commits_nuke-2.0.0.tar.gz:

Publisher: publish.yml on joelromanpr/commits-nuke

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file commits_nuke-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: commits_nuke-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for commits_nuke-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a6fbebf3bbefa25236a08d760402c47c37bd2fb593d4d420adc38b19eddd6d
MD5 646cd32f9023c60438bc65794306b583
BLAKE2b-256 1d7a373f0f84bb54a83dc08962608d4f69b961ba1d5ef54aef1af92506e896b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for commits_nuke-2.0.0-py3-none-any.whl:

Publisher: publish.yml on joelromanpr/commits-nuke

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page