git-secrets is a Git extension that helps prevent secrets—API keys, credentials, tokens, private keys—from being accidentally committed into version control. It works by applying configurable regular-expression patterns over commit contents (and merge history) and rejecting commits or merges that violate the policy. The tool includes hooks that integrate into git commit and git merge, as well as commands to list, add, or remove secret patterns, and to scan existing history for leaks. Teams often deploy it as part of their developer toolchain to enforce a security guardrail: you catch leaks early rather than discovering them later. It is also often used in CI pipelines or continuous code quality checks to detect in-flight vulnerabilities. While git-secrets is not a full secrets management system, it plays a key role in defense-in-depth by preventing accidental exposure in source.

Features

  • Installs Git hooks (pre-commit, commit-msg, prepare-commit-msg) that block commits or merges containing prohibited patterns
  • Ability to scan past history (all commits, existing repository) for patterns to catch issues retroactively
  • Configurable prohibited and allowed patterns via regex or literal matching, allowing suppression of false positives
  • Support for “secret providers” which are executables that output additional prohibited patterns (e.g. AWS credentials)
  • Cross-platform install support: *nix (Linux/macOS), Windows via PowerShell, Homebrew etc.
  • Optionally skip checks via --no-verify for special cases, also ability to set global templates so new repos automatically include hooks

Project Samples

Project Activity

See All Activity >

Categories

Git

License

Apache License V2.0

Follow git-secrets

git-secrets Web Site

Other Useful Business Software
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of git-secrets!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

PowerShell

Related Categories

PowerShell Git Software

Registered

2025-09-19