#1051·gitleaks

.gitleaksignore file is ignored when using pre-commit

Author: fabasoadCreated Dec 3, 2022Updated Aug 28, 2026
Labelsbug

Describe the bug I have a frontend project that generates uuid during tests and save them into *.snap files. These uuid are OK to commit but gitleaks detects them as secrets, which is fine. Though, adding fingerprints of each error to .gitleaksignore file to ignore them - doesn't help.

To Reproduce

  1. Have project with secret hardcoded.
  2. Add pre-commit-config.yaml file with the content below. (Additional context: [1])
  3. Run pre-commit run gitleaks.
  4. Be sure that secret is detected.
  5. Create .gitleaksignore file and copy-paste fingerprint from the output at step 4.
  6. Run pre-commit run gitleaks.

Actual behavior gitleaks detects that line anyway, meaning that .gitleaksignore file is ignored.

Expected behavior Line which fingerprint has been added to the .gitleaksignore file shouldn't be detected anymore.

Screenshots N/A

Basic Info (please complete the following information):

  • OS: macOS Monterey, version 12.6
  • Gitleaks Version: 8.5.12

Additional context [1] pre-commit-config.yaml:

yaml
- repo: https://github.com/zricethezav/gitleaks
  rev: v8.15.2
  hooks:
    - id: gitleaks

cc @zricethezav