.gitignore Generator
Build a .gitignore by combining curated templates for 13 languages, 7 frameworks, macOS/Windows/Linux and popular IDEs. Duplicates are removed automatically.
What is .gitignore Generator?
A .gitignore file tells Git which files to leave out of version control, such as dependencies, build output, logs, secrets and editor settings. Tick the languages, frameworks, operating systems and editors your project uses and the tool combines curated templates into one clean .gitignore, removing duplicate patterns.
How to use .gitignore Generator
- Tick the templates you need under Languages, Frameworks, Operating systems and Editors and IDEs (use Filter templates to find one).
- Add project-specific lines under Extra patterns.
- Copy the result or download it as
.gitignoreand put it in the root of your repository.
Example
Node.js + macOS
# ===== Node.js ===== # Dependencies node_modules/ jspm_packages/ … # Environment .env .env.* !.env.example # ===== macOS ===== .DS_Store .AppleDouble .LSOverride ._* .Spotlight-V100 .Trashes
When to use .gitignore Generator
Use it when starting a repository or when adding a new tool to a project. Note that .gitignore only affects untracked files: if a file is already committed, remove it from the index with git rm --cached <file> first. Commit the .gitignore itself so the whole team shares it; put personal editor files in your global gitignore instead if you prefer.
How .gitignore Generator works
The templates are curated from the widely used github/gitignore collection and trimmed to the essentials. They are concatenated in a fixed order (languages → frameworks → OS → editors), each under a # ===== Name ===== header. A pattern that already appeared in an earlier template is skipped, comment headers left without patterns are dropped, and extra patterns you add are appended under a Custom section if they are not already present.
Common Use Cases
- Starting a new Node.js, Python or Java repository
- Keeping .env files and secrets out of Git
- Ignoring OS clutter like .DS_Store and Thumbs.db
- Combining rules for a monorepo with several stacks
FAQs
Why is a file still tracked after I added it to .gitignore?
Git only ignores untracked files. Run git rm --cached <file> (or -r for folders), commit, and it will be ignored from then on.
What does the ! prefix mean?
It re-includes a file that an earlier pattern ignored, e.g. !.env.example keeps the example env file while .env.* ignores the others.
Should I ignore editor folders like .vscode?
The VS Code template ignores personal state but keeps shared settings, tasks, launch configurations and recommended extensions.