Von Gast (nicht überprüft) , 29 April 2026

Warum eine gute .gitignore wichtig ist

Jede versehentlich committete node_modules, .env oder kompiliertes Binary ist technische Schuld.

Node.js

# Dependencies
node_modules/
.pnp
.pnp.js

# Build output
dist/
build/
out/
.next/
.nuxt/
.vite/

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Environment
.env
.env.local
.env.*.local

# Editor
.vscode/
.idea/
*.swp

# Coverage
coverage/
.nyc_output/

Python

# Byte-compiled
__pycache__/
*.py[cod]
*$py.class

# Packaging
*.egg-info/
*.egg
build/
dist/
pip-wheel-metadata/

# Virtual envs
.venv/
venv/
env/
ENV/

# Tools
.pytest_cache/
.mypy_cache/
.ruff_cache/
.tox/
.coverage
htmlcov/

# Jupyter
.ipynb_checkpoints/

# Editor
.idea/
.vscode/

# Environment
.env

Rust

# Build output
target/
Cargo.lock

# Binaries
*.exe
*.dll
*.so
*.dylib

# Fuzzing
artifacts/
corpus/

# IDE
.idea/
.vscode/
*.iml

PHP / Composer

vendor/
composer.phar

# Cache
.phpunit.result.cache
.php-cs-fixer.cache
.phpstan-cache/

# Symfony / Laravel
/var/cache/*
/var/log/*
/public/uploads/
.env
.env.local

# IDE
.idea/
.vscode/
*.iml

Java / Gradle / Maven

# Compiled
*.class
*.jar
*.war
*.ear

# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup

# Gradle
.gradle/
build/
!gradle/wrapper/gradle-wrapper.jar

# IDE
.idea/
*.iml
.classpath
.project
.settings/
.vscode/

# Logs
*.log

Ubergreifende Essentials

# OS
.DS_Store
Thumbs.db
desktop.ini

# Editors
*.swp
*.bak
*~
.vscode/
.idea/

# Secrets
*.pem
*.key
.env*
!.env.example

Globale gitignore

git config --global core.excludesfile ~/.gitignore_global

Aus Templates generieren

curl -sL https://www.toptal.com/developers/gitignore/api/node,python,visualstudiocode,macos > .gitignore

Auditing

git status --ignored
git check-ignore -v path/to/file