Lesson 22 / 28
.gitignore
Keep build output, dependencies and secrets out of Git with .gitignore patterns.
Patterns to exclude
A .gitignore file at the repo root lists patterns Git should never stage — build output, dependencies, secrets.
node_modules/
dist/
.env
*.logAlready-tracked files ignore it
.gitignore only affects untracked files. If a file is already committed, remove it from tracking with git rm --cached <file> first.