fix(gitignore): ignore .env files at any level, keep .env.example templates

The documented setup flow creates a real .env at the repo root (cp .env.example .env) but only deploy/.env was ignored, so root-level secrets could be committed by accident. Replace the single-path rule with .env / .env.local / .env.*.local at any level; tracked .env.example templates are unaffected.
This commit is contained in:
Lcos 2026-07-21 18:02:58 +08:00 committed by GitHub
parent 02772d58b8
commit 945d8b40a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

9
.gitignore vendored
View File

@ -94,8 +94,13 @@ deploy/nginx/ssl/*.crt
deploy/nginx/ssl/*.key
deploy/nginx/ssl/*.pem
# Deploy env
deploy/.env
# Env files (real secrets - do not commit)
# .env matches any level; .env.example / *.env.example are templates and stay tracked.
.env
.env.local
.env.*.local
!.env.example
!**/.env.example
# Claude Code local settings
CLAUDE.md