git-secret-cleanup

Remove committed secrets from git history and update .gitignore.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/juliuss1907/knowledge-base --skill git-secret-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-secret-cleanup
Source: https://github.com/juliuss1907/knowledge-base/tree/main/.hermes/skills/git-secret-cleanup
Command: npx skills add https://github.com/juliuss1907/knowledge-base --skill git-secret-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill tackles the issue of sensitive information accidentally committed to git history, offering a comprehensive solution for clean-up, ignore list updates, and safe history force-pushes.

Core Features & Use Cases

  • Git History Clean-up: Identifies and removes committed secrets using filter-branch.
  • .gitignore Update: Adds new entries to prevent future secret leakage.
  • Force-Push Security: Ensures clean history by force-pushing with git push --force-with-lease.
  • Use Case: If you find that a commit pushed to your repository contains sensitive data, use this Skill to rectify the situation while preserving collaboration integrity.

Quick Start

To use this Skill, run the command: git-secret-cleanup run.

Frequently Asked Questions about git-secret-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove sensitive data accidentally committed to git history?

Git history cleaning removes sensitive data by identifying accidental secret commits and using filter-branch to strip them from the repository timeline. This normalizes repository history to prevent credential theft while preserving collaboration integrity.

What is the best way to prevent future secret leakage in a git repository?

Preventing git secret leakage involves updating .gitignore with new entries to block sensitive files from being tracked. This ensures repository integrity and data security by stopping credentials from entering future commits.

How does a secure force push work when cleaning git history?

A secure force push uses git push --force-with-lease to safely overwrite remote repository history. This ensures clean history by verifying no unexpected remote changes are overwritten during the history normalization process.

When do I need to clean git secrets from my repository history?

You need to clean git secrets when a commit containing sensitive information like credentials is pushed to your repository. Rectifying this situation quickly is crucial to avoid credential theft and maintain repository integrity.

Can I use a single command to identify secrets and force push a clean git history?

Yes, you can execute the full workflow from secret identification to repository history normalization with a single command. This automates filter-branch cleaning, .gitignore updates, and a secure force push to ensure data security.