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
| Pattern | Meaning |
|---|---|
| *.log | Ignore all .log files |
| build/ | Ignore the build directory (trailing slash = directory only) |
| !important.log | Negate — do NOT ignore this file |
| **/logs | Match in any directory depth |
| doc/*.txt | Match only in doc/ directory (not subdirs) |
| # comment | Comments start with # |
Best Practices
- Always ignore
.envfiles — they contain secrets - Ignore
node_modules/andvendor/— reinstall from lockfiles - Ignore IDE-specific directories (
.idea/,.vscode/) unless you share settings - Use
!.gitkeepto 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.