From common-utilities
Permanently deletes all local and remote git history, reinitializing the repo with a single clean commit. Requires multiple confirmations and a remote URL.
How this command is triggered — by the user, by Claude, or both
Slash command
/common-utilities:git-deleteUtilities/Files this command reads when invoked
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Git History Delete Command ⚠️ **DESTRUCTIVE OPERATION WARNING** ⚠️ This command will **permanently and irreversibly** delete the entire git history for this repository, both locally and remotely. ## What This Command Does 1. Deletes the entire local `.git` directory (all history, branches, tags, stashes) 2. Initializes a fresh git repository with zero history 3. Creates a single new commit with the current state of files 4. Force-pushes to remote, **overwriting all remote history** ## Consequences - **All commit history permanently deleted** - cannot be recovered - **All branches an...
⚠️ DESTRUCTIVE OPERATION WARNING ⚠️
This command will permanently and irreversibly delete the entire git history for this repository, both locally and remotely.
.git directory (all history, branches, tags, stashes)CRITICAL CHECKS:
Follow these steps to execute the git history deletion:
Use the AskUserQuestion tool to confirm the user wants to proceed:
Question: "Are you absolutely certain you want to permanently delete all git history? This operation cannot be undone and will affect all collaborators."
Options:
Ask the user to provide the new repository URL where the cleaned history will be pushed:
Question: "What is the remote repository URL? (e.g., https://github.com/username/repo.git or git@github.com:username/repo.git)"
If the user wants to keep the existing remote, ask them to confirm they understand the remote will be force-overwritten.
Before deletion, show the user:
Use these commands:
git rev-list --count HEAD
git branch -a
git remote -v
Present a final summary and ask for explicit confirmation:
Summary to show:
Final question: "Type 'DELETE HISTORY' to confirm and proceed, or anything else to cancel."
Only if user provided exact confirmation, execute these commands sequentially:
# Remove all git history
rm -rf .git
# Initialize fresh repository
git init
# Stage all current files
git add .
# Create initial commit
git commit -m "Initial clean commit"
# Rename branch to main
git branch -M main
# Add remote (use URL from Step 2)
git remote add origin <repository-url>
# Force push to remote (overwrites remote history)
git push -u origin main --force
After execution, verify success:
# Verify clean state
git log --oneline
git status
git remote -v
Show the user:
Inform the user to notify all collaborators to:
# Delete their local clone
cd ..
rm -rf <repo-directory>
# Clone fresh copy
git clone <repository-url>
Execute these steps carefully and ensure the user fully understands the consequences at each confirmation point.
npx claudepluginhub reggiechan74/vp-real-estate --plugin common-utilities/sanitize-gitSanitizes git history by removing Claude/AI traces from commit messages and co-authors, fixes tracked .gitignore exclusions and forbidden content. Requires risk confirmation and creates backup.
/bcleanSafely cleans up local Git branches without open PRs and stale worktrees based on age threshold. Supports --dry-run, --force, --days N, --help options.
/gitExecutes Git operations (status, add, commit, push, pull, branch, merge) with intelligent commit messages, branch management, workflow optimization, and status recommendations.