All Tools View Categories About Contact Privacy

.gitignore Checker

Does your .gitignore actually protect your .env? Test any path against your patterns.

Runs entirely in your browser — nothing is uploaded.

About .gitignore Checker

Committing a .env file is the leak that cannot be un-witnessed. The .gitignore Checker asks the one question a repository owner should be able to answer instantly: if I run git status, would my private env files show up?

It applies Git's ignore semantics to your .gitignore — pattern anchoring, trailing-slash directories, negation with !, and the last-match-wins ordering — and tests a candidate path you name, typically .env or config/app/.env. The verdict is one of IGNORED, TRACKED or EXCEPTED, with the matching rule shown.

The riskiest case, a negated !.env reopening an ignored file, is called out explicitly. All matching runs in your browser.

Features

  • Git ignore semantics: anchoring, dirs, negation, ordering.
  • Verdict per path: IGNORED, TRACKED or EXCEPTED.
  • Nested paths: test config/dev/.env too.
  • Rule attribution: which pattern decided it.
  • Negation warning: !.env that un-ignores is flagged.
  • Common-safety checks: .env, .env.*.local, etc.
  • Copy or download: export the report.
  • Private: fully client-side.

How to Use

  1. Paste your .gitignore into the first box, or load the sample.
  2. Name the env file path to test (default .env).
  3. Click Check. The verdict appears with the matching rule.
  4. Review the safety list of common env file names.

Examples

Example 1 — The classic mistake. A .gitignore has .env but also !.env.example never used .env.example is fine — but a stray !.env would silently re-expose it. The checker calls it out.

Example 2 — Nested config. A config folder stores env files as config/app/.env; the checker tests the nested path against the top-level pattern.

Example 3 — Committed already. If .env exists in git, ignoring it does nothing. The report reminds the user to remove it from tracking first.

Example 4 — Exception audit. A pattern list using *.env but a !production.env override is verified not to re-include the secret file.

Example 5 — Template hygiene. A public template runs the checker before release so contributors never see the owner's local keys.

Benefits

  • Definitive answers: ignored, tracked or excepted.
  • Risk surfaced: negations flagged loudly.
  • Git-accurate: real ignore semantics.
  • Coverage view: common env names all tested.
  • Private: stays in-browser.
  • Free: ready for every repo.

Frequently Asked Questions

What does this tool verify?
It checks the answer to the most important question about a repo: is your private .env file actually ignored by git? It tests whether your .gitignore patterns cover a given env file path.
How does it test a pattern?
It applies Git’s ignore rules to a candidate path — directory matching, trailing-slash directory patterns, leading-slash anchoring, negation with ! and the last-match-wins ordering — and reports the outcome as IGNORED, TRACKED or EXCEPTED.
Does it handle negation (!.env)?
Yes. A negated pattern that re-includes an env file is reported as an exception, which is exactly the dangerous case: a .gitignore that both ignores and un-ignores .env.
Does it check nested folder .env files?
Yes. Patterns not starting with / match in any directory, so config/dev/.env is tested too, along with the root case.
Is anything uploaded?
No. All evaluation is client-side; your patterns and paths never leave the page.