- First commitRecord the marker
+ synthetic marker - Second commit · HEADReplace the file
− synthetic marker
What stays in Git history?
Comparing directory and Git-history scans with Gitleaks 8.30.1
A marker is committed, then removed. Two fresh Linux workers scan the current files and the complete history. A second repository holds a clean control.
8 of 8 observations matched the expected counts. Git history preserved the marker after the working tree was clean.
Scan resultsExpected and observed findings for each sampleMeasured
| Sample | Scope | Expected | Run 1 | Run 2 |
|---|---|---|---|---|
| Removed marker | Current files | 0 | 0 | 0 |
| Removed marker | Git history | 1 | 1 | 1 |
| Clean control | Current files | 0 | 0 | 0 |
| Clean control | Git history | 0 | 0 | 0 |
Measured 2026-11-23 UTC. Each measurement ran in a fresh ARM64 Linux VM using two new Git repositories. Run 1 JSON Run 2 JSON
Experimental methodPaired controls, redaction, and interpretation
Build a paired control
Create two disposable repositories with the same two commits. Write an inert marker in one and ordinary text in the other. Replace both files with identical clean text.
Change the scan scope
Run the same pinned scanner and custom rule in directory and Git-history modes. Redact the matched values and count only findings in the sample file.
Interpret the result
The experiment measures detection of one known pattern across scan scopes. Production detection rates would require a representative set of real-world cases.