.gitignore
Cheat sheet · https://pcornel.dk/topic.php?topic=5478
Answer
.gitignore lists file patterns Git should not offer to track, such as build output and local settings. It does not affect files already committed — remove those with git rm --cached — and it is not a way to protect secrets.
Remember
- Ignored ≠ untracked automatically; files already in the index remain tracked despite matching a .gitignore rule.
- .gitignore ≠ secret protection; ignored files can still be read, copied, logged or force-added.
- Pattern present ≠ pattern matches intended path; anchoring, directory context and negation affect results.
- File absent from status ≠ file absent from repository history; secrets may remain in prior commits.
First checks
cat .gitignore— patternsgit check-ignore -v <file>— why ignoredgit status --ignored— ignored files
Verify in this order
file → ignore rules → not tracked
Where it usually breaks
An ignore match proves Git will normally suppress an untracked path from discovery; it does not untrack existing content, erase history or secure sensitive data.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
.gitignore Git boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Local state | Repository, HEAD, worktree/index and commit IDs are explicit | Wrong repo/ref, hidden staged/untracked state or mutable-name ambiguity |
| History / refs | Ancestry and branch/tag movement match intent | Unexpected rewrite, stale tracking ref or unclear merge base |
| Remote sync | URL/refspec, auth and remote read-back match expected commits | Local assumptions, rejection, stale fetch or unsafe force update |
| Downstream proof | Build/reconciliation/target is verified independently | Push/tag/merge success treated as deployment success |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5478