bashbeginner
.gitignore Patterns and Templates
Comprehensive .gitignore patterns for Node.js, Python, and general development environments.
bashPress ⌘/Ctrl + Shift + C to copy
# .gitignore — Universal patterns
# === Dependencies ===
node_modules/
venv/
.env.local
.env*.local
# === Build outputs ===
dist/
build/
out/
.next/
__pycache__/
*.pyc
# === OS files ===
.DS_Store
Thumbs.db
*.swp
*.swo
*~
# === IDE files ===
.idea/
.vscode/
*.code-workspace
*.suo
*.ntvs*
# === Logs ===
logs/
*.log
npm-debug.log*
yarn-debug.log*
# === Secrets ===
.env
.env.production
*.pem
*.key
# === Testing ===
coverage/
.nyc_output/
.pytest_cache/
# === Misc ===
*.tgz
*.tar.gz
*.zip
# === Negate (force track) ===
!.gitkeep
!.env.example
# Check what's being ignored
# git status --ignored
# Remove cached file that's now in .gitignore
# git rm --cached filename
# Global gitignore
# git config --global core.excludesfile ~/.gitignore_globalUse Cases
- Setting up gitignore for new projects
- Preventing secrets from being committed
- Cleaning up ignored tracked files
Tags
Related Snippets
Similar patterns you can reuse in the same workflow.
bashintermediate
Git Hooks Pre Commit
Git workflow: git-hooks-pre-commit
Best for: version control
#git#version-control
bashadvanced
Git Hooks Post Commit
Git workflow: git-hooks-post-commit
Best for: version control
#git#version-control
bashadvanced
Git Lfs Large Files
Git workflow: git-lfs-large-files
Best for: version control
#git#version-control
bashbeginner
Git Annex
Git workflow: git-annex
Best for: version control
#git#version-control