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
Go From AI Idea to AI App Fast Icon
Go From AI Idea to AI App Fast

One platform to build, fine-tune, and deploy ML models. No MLOps team required.

Access Gemini 3 and 200+ models. Build chatbots, agents, or custom models with built-in monitoring and scaling.
Try Free
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