Skip to content
Reference & Best Practices7 min readProduction Tested

.gitignore Examples for Modern Tech Stacks

Copy-paste production-ready .gitignore snippets for the most widely used frameworks and languages. Each example filters out build directories, lockfile conflicts, local secrets, and machine-specific metadata.

1. Node.js, TypeScript & React

Full Node template →

Covers package managers (npm, pnpm, yarn), TypeScript compilation outputs, Next.js build caches, and environment files.

# Dependencies
node_modules/
.pnp
.pnp.js

# Build outputs
dist/
build/
.next/
out/

# Debug and runtime logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Environment files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

2. Python, Django & FastAPI

Full Python template →

Excludes bytecode caches (__pycache__), virtual environments (.venv), pytest caches, and distribution packages.

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

# Virtual environments
.venv/
env/
venv/
ENV/

# Distribution & packaging
build/
dist/
*.egg-info/
.eggs/

# Testing & coverage
.pytest_cache/
.coverage
htmlcov/

3. Java, Maven & Spring Boot

Full Spring Boot template →

Excludes Maven target/, Gradle build/, compiled *.class files, and local Spring configurations.

# Compiled class files
*.class

# Package files
*.jar
*.war
*.ear

# Maven and Gradle build targets
target/
build/
.gradle/

# Spring Boot crash dumps and local configs
*.hprof
application-local.*
application-secret.*

Filters out massive Unity generated library caches ([Ll]ibrary/), temporary files, and IDE project files (*.csproj).

[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Mm]emoryCaptures/

# Visual Studio & Rider project files generated by Unity
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln

Need a Custom Combination?

Don't settle for single-technology templates. Use DotGitIgnore to combine your operating system, editor, backend, and frontend into one deterministic ignore file.

Launch Generator