Developer Tools
.gitignore Generator - Create .gitignore Files Instantly
Generate .gitignore files for Node, Python, Java, Go, Rust, and 15+ other languages, frameworks, and IDEs. Combine multiple templates in one click.
Languages
Frameworks
IDEs
Operating Systems
35 lines
How .gitignore works
A .gitignore file tells Git which files and directories to leave untracked. Git checks
the file on every git status and git add operation. Patterns are matched
against paths relative to the location of the .gitignore file.
Pattern syntax
*.log- ignore all.logfiles anywhere/build/- ignore only the top-levelbuild/directory-
node_modules/- ignore anynode_modulesdirectory at any depth !important.log- negate a pattern (always track this file)**/*.map- ignore any.mapfile at any depthdoc/**/*.txt- all.txtfiles underdoc/
Already-tracked files
Adding a file to .gitignore does not automatically untrack it if Git
is already tracking it. You must run:
git rm --cached <file> to stop tracking a previously-committed file while keeping it on disk.
Global gitignore
For editor temp files and OS-specific files you never want tracked in any repository, use a global gitignore file. Configure it once:
git config --global core.excludesfile ~/.gitignore_global
Add entries like .DS_Store, Thumbs.db, .vscode/,
*.swp (Vim swap files). This avoids polluting project-level .gitignore
files with personal tooling exclusions.
Negation patterns
A pattern starting with ! negates a previous pattern - the file is tracked even if
it would otherwise be ignored. Order matters: a negation must come after the
pattern it overrides.
*.log
!important.log # This IS tracked despite *.log rule above A directory cannot be re-included if its parent is already ignored; you must unignore the parent first.