sanitize-git-repo

Detect and remove committed secrets from git repositories and history.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/bianhaifeng789-hue/openclaw-config --skill sanitize-git-repo-bianhaifeng789-hue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanitize-git-repo
Source: https://github.com/bianhaifeng789-hue/openclaw-config/tree/main/skills/tb2/sanitize-git-repo
Command: npx skills add https://github.com/bianhaifeng789-hue/openclaw-config --skill sanitize-git-repo-bianhaifeng789-hue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams identify and remove sensitive information such as API keys, tokens, passwords, and private keys from both the working tree and the git history to prevent credential exposure, prepare repositories for public release, and meet security compliance requirements.

Core Features & Use Cases

  • Comprehensive detection: Pattern-based, file-type, and entropy analysis to find likely secrets across text and binary files.
  • Safe working-directory sanitization: Replace secrets with consistent placeholders, validate file syntax, and preserve file integrity.
  • History rewriting options: Guidance for using BFG, git filter-repo, or git filter-branch to remove secrets from commit history and coordinate force-push and re-cloning.
  • Use Case: A developer preparing a private repository for open-source release can scan for leaked credentials, replace them with placeholders, rewrite history to remove commits containing secrets, and then instruct the team to rotate exposed credentials.

Quick Start

Use the sanitize-git-repo skill to scan your repository for secrets, replace exposed values with standardized placeholders, and rewrite git history using BFG or git filter-repo while coordinating credential rotation.

Frequently Asked Questions about sanitize-git-repo

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

FAQPage Schema
How do I remove secrets from git history before making a repo public?

To remove secrets from git history before a public release, you can scan the repository for credentials, replace exposed values with placeholders, and rewrite history using BFG or git filter-repo.

What is the best way to sanitize a git repository after a credential leak?

Sanitizing a git repository after a credential leak involves identifying committed secrets, replacing them with consistent placeholders in the working directory, rewriting commit history, and coordinating credential rotation.

Does git filter-repo or BFG work better for scrubbing sensitive data from commits?

Both git filter-repo and BFG are supported options for scrubbing sensitive data from commits. The skill provides guidance for using either tool to rewrite history and coordinate force-pushes and re-cloning.

How do I detect API keys and passwords hidden in git commits?

Detecting API keys and passwords in git commits is done through pattern-based analysis, file-type checks, and entropy analysis to find likely secrets across both text and binary files.

What should I do after rewriting git history to remove exposed tokens?

After rewriting git history to remove exposed tokens, you must enforce verification of placeholder consistency, coordinate a force-push, instruct the team to re-clone, and guide credential rotation.