gitredact

Rewrite Git history to replace a secret or delete a file — across all commits. Pure Go, no external tools required.

⚠ This tool rewrites history permanently. Always run with --dry-run first. After rewriting, collaborators must re-clone or hard-reset. Rotate any exposed secrets.
curl -fsSL https://raw.githubusercontent.com/haukened/gitredact/main/install.sh | sh

Installs the latest release binary to ~/.local/bin and adds it to your PATH. Supports bash, zsh, and fish.


go build -o gitredact ./cmd/gitredact

Requires Go 1.21+.

irm https://raw.githubusercontent.com/haukened/gitredact/main/install.ps1 | iex

Installs the latest release binary to %USERPROFILE%\.local\bin and updates your user PATH permanently.
To inspect before running: download with irm <url> -OutFile install.ps1, then run .\install.ps1.


go build -o gitredact.exe ./cmd/gitredact

Requires Go 1.21+.