Skip to content

ev-smoke/gitleak-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Gitleaks Pre-commit Hook Installer

A cross-platform Git pre-commit hook that integrates Gitleaks to automatically scan your staged code for secrets before every commit.


πŸ“Œ Purpose

This hook helps you prevent accidental commits of sensitive data such as:

  • API keys
  • Tokens
  • Passwords
  • Secrets in environment files or source code

If secrets are detected, the commit is blocked and a warning is displayed.


βš™οΈ Supported Platforms & Architectures

Operating System Supported Architectures
Linux x86_64, arm64
macOS x86_64, arm64 (M1/M2)
Windows x86_64

πŸš€ Installation

You can install the pre-commit hook and gitleaks in one command using curl:

curl -sSL https://raw.githubusercontent.com/ev-smoke/gitleak-checker/main/install.sh | bash

πŸ›  Configuration

during installation script set enable flag for git config, but any time you can set it manually

Enable or disable the hook at any time using Git config:

# Enable the hook (default)
git config gitleaks.enabled true

# Disable the hook
git config gitleaks.enabled false

πŸ§ͺ Example Usage

# Add a file that accidentally contains a secret
git add config.py

# Attempt to commit
git commit -m "Add config"

# Output:
# [Gitleaks] Secret(s) detected. Commit rejected.

πŸ“¦ Notes

  • If gitleaks is not installed, the script will download it automatically.

  • You can add ~/.gitleaks/ to your PATH to use gitleaks globally:

echo 'export PATH="$HOME/.gitleaks:$PATH"' >> ~/.bashrc
source ~/.bashrc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages