Saylor InnovationsSAYLOR INNOVATIONS

Home / Guides / Self-Hosting & Infra

Why .gitignore Is Not Working: Already-Tracked Files, Negation Rules, check-ignore and Secrets in History

Self-Hosting & Infra beginner 5 min read $0.01 Updated 2026-10-20

Tested on Git 2.34: ignoring a tracked .env changes nothing, git rm --cached fixes future state, check-ignore -v shows the matching rule, !keep.log works but !logs/keep under logs/ does not, and git log -S finds the secret still in history.

You added a file to .gitignore but git still shows changes. Untrack with git rm --cached, debug rules with git check-ignore -v, fix negation patterns, and learn that history keeps committed secrets.

Read the full guide

The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.

Open in the Knowledge Base Agent API →