Basic Syntax

node_modules/
dist/
.env
*.log
.DS_Store

When .gitignore Doesn’t Work

git rm -r --cached filename
git add .
git commit -m "stop tracking filename"

Generate Automatically

Visit https://www.toptal.com/developers/gitignore

Key Points

  • Never commit .env files
  • Already-committed files need git rm --cached