Navigate your terminal into the folder that contains the git repo you want to check, then run the scan. The 'git' command tells Gitleaks to walk through every commit in the repo's history — not just the files as they look today. Replace '/path/to/your/repo' with the actual folder path if using Docker.
$ # Homebrew install — run from inside the repo folder
$ cd /path/to/your/repo
$ gitleaks git -v
$
$ # Docker install — replace /path/to/your/repo with your real path
$ docker run --rm -v /path/to/your/repo:/path zricethezav/gitleaks:latest git -v /path
What you should see
If secrets are found: a table showing Finding, Secret, RuleID, File, Line, Commit, and Author for each leak, then exit code 1.
If nothing is found: 'No leaks found.' and exit code 0.
This might happen
Docker reports 'invalid mount config' or 'no such file'
Make sure you use the full absolute path to your folder (e.g. /Users/yourname/projects/myrepo on Mac, or C:/Users/yourname/projects/myrepo on Windows). On Windows also enable folder sharing in Docker Desktop settings.