A .gitignore file tells Git which files and directories to ignore — not track in version control. It's used to exclude generated files, dependencies, secrets, and environment-specific files that shouldn't be committed.
What .gitignore does
# .gitignore — patterns of files Git should NOT track
node_modules/ # dependencies (reinstalled from package files, don't commit)
dist/ # build output (generated, don't commit)
*.log # log files
.env # ⚠️ SECRETS / environment variables — NEVER commit!
.DS_Store # OS-specific junk
.vscode/ # editor config (often personal)
build/
coverage/
*.tmp
