.gitignore Generator
Select templates to combine into a single .gitignore file.
Languages
Frameworks
Editors
OS
Understand .gitignore Generator
Builds a .gitignore file by combining any of 20 built-in templates covering languages, frameworks, editors, and operating systems.
How it works
Each template is a curated block of patterns — build output, dependency directories, editor state, OS clutter — and the generator concatenates the ones you select under labeled headers. Git reads the file top to bottom and the last matching pattern wins, so a later negation such as !keep.me overrides an earlier exclusion. A pattern ending in a slash matches directories only, and a pattern containing no slash matches at any depth in the tree.
When to use it
- Starting a repository and wanting sensible exclusions in place before the first commit.
- Combining a language template with your editor and operating system, which is the usual real case.
- Adding a framework build directory (React, Angular, Vue, Django, Terraform, Unity, Gradle, Maven) to a file you already have.
- Reminding yourself which artifacts a toolchain generates and should never be committed.
Watch out for
- .gitignore does not untrack a file that is already committed. Git keeps tracking it regardless of the pattern — run git rm --cached <path> and commit that before the rule takes effect.
- Ignoring a secret is not protecting one. If .env was ever committed it remains in history and is readable by anyone with a clone; rotate the credential and rewrite history rather than assuming the ignore fixed it.
- A negation cannot re-include a file inside an excluded directory. Once build/ is ignored git never descends into it, so !build/keep.txt does nothing — exclude build/* instead so the directory itself is still traversed.
- Editor and OS patterns belong in your personal global ignore file, not in a repository everyone shares. git config --global core.excludesFile ~/.gitignore_global keeps .DS_Store and .idea/ out of a file your colleagues have to read.
Frequently Asked Questions
How to create a .gitignore file?
Select your language (Node.js, Python, Java, etc.) and any editor or OS templates (VS Code, macOS, Windows). Click Generate, then copy or download the result and save it as .gitignore in your project root. Git reads this file automatically on every commit.
How to create a .gitignore file in VS Code?
In VS Code, open the terminal (Ctrl+`) and run: curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore — or use this generator, copy the output, and paste it into a new file named .gitignore in your project root.
Why am I still seeing ignored files in git status?
If files were tracked before .gitignore was created, git still tracks them. Remove them from the index with: git rm --cached <file> (or git rm -r --cached . for all tracked files). The file stays on disk but disappears from git status after the next commit.
How to Use .gitignore Generator
- Paste or type your input in the input area above.
- The tool processes your input automatically or click Run.
- Copy or download the result using the action buttons.
- Use Ctrl+Enter to run quickly from the keyboard.