.gitignore
A text file listing patterns Git should never track: build artifacts, secrets, large data.
- Glob patterns; ! negates; / anchors to root.
- Already-tracked files require git rm --cached first.
- Critical before first commit.
When to use: Every project - before the first commit.
Example: Python ML: __pycache__/, *.pyc, .venv/, data/raw/, *.ckpt, wandb/, .env.