Skip to main content

rawops.dev

Skip to tool content

.gitignore Generator

0 selected

Quick Start — Stack Presets

Languages

Frameworks

IDEs / Editors

Operating Systems

Tools & Config

Custom Patterns

Select templates above or use a stack preset to generate your .gitignore

What is .gitignore?

A .gitignore file tells Git which files and directories to ignore in a project. This prevents build artifacts, dependencies, IDE settings, OS-specific files, and secrets from being committed to your repository.

Place the .gitignore file in the root of your repository. Patterns in the file match relative to the repository root. You can also have nested .gitignore files in subdirectories.

Pattern Syntax

PatternMeaning
*.logIgnore all .log files
build/Ignore the build directory (trailing slash = directory only)
!important.logNegate — do NOT ignore this file
**/logsMatch in any directory depth
doc/*.txtMatch only in doc/ directory (not subdirs)
# commentComments start with #

Best Practices

  • Always ignore .env files — they contain secrets
  • Ignore node_modules/ and vendor/ — reinstall from lockfiles
  • Ignore IDE-specific directories (.idea/, .vscode/) unless you share settings
  • Use !.gitkeep to track empty directories
  • Add OS files (.DS_Store, Thumbs.db) to your global gitignore instead

Privacy: This tool runs entirely in your browser. No data is sent to any server.

Related Tools & Resources