How to use the .gitignore Generator
- Pick the languages, frameworks, editors and operating systems you use.
- Review the combined file.
- Download it as .gitignore and put it in your project root.
What does this tool do?
A .gitignore file tells Git which files never to commit — dependencies like node_modules, build output, editor settings, OS clutter like .DS_Store, and secrets in .env files.
Templates are organised into sections with headings, so it's easy to see why each rule is there and edit it later.
Why use it?
- 24 templates.
- Sectioned and commented.
- Download as .gitignore.
Use cases
- Start a new repository.
- Clean up a repo that commits junk files.
- Combine rules for multi-language projects.
A Node project on a Mac using VS Code
Choose Node, macOS and VS Code. The file includes node_modules/, build output such as dist/, .env files, .DS_Store and editor folders like .vscode/, each under its own heading.
Common mistakes
- Committing .env files with secrets.
- Ignoring lock files like package-lock.json, which should usually be committed.
- Adding personal editor rules to every project — use a global gitignore for those.
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Frequently asked questions
I added a file to .gitignore but Git still tracks it.
Git keeps tracking files it already knows about. Run git rm --cached <file> to stop tracking it while keeping it on disk.
Where does .gitignore go?
In your project's root folder. Subfolders can have their own too.
What is a global gitignore?
A file for your own machine's clutter (like .DS_Store), set with git config --global core.excludesFile.
How do I ignore a folder?
Add its name with a trailing slash, like build/.
Content last updated . See how M2Toolkit works.