Not everything should be in your repository — passwords, build files, IDE junk. .gitignore tells Git what to pretend doesn't exist.
Your project has files that should never be committed:
🔑 .env — your API keys and passwords
📦 node_modules/ — thousands of dependency files
🗑️ .DS_Store — macOS junk
⚙️ dist/ — built files that can be regenerated
Put their names in .gitignore
and Git will invisibly skip them forever.
The ignored files will never show up in git status
or be included in commits. Your passwords stay local,
and your repo stays clean.
Pro tip: check out gitignore.io for ready-made templates
for Node, Python, Java, and more.
Rule of thumb: if a file is generated, personal, or secret — it belongs in .gitignore, not in your repository.