About the .gitignore Generator
Every new repository needs a .gitignore so that dependencies, build output, secrets, and editor clutter stay out of version control. This .gitignore Generator combines ready-made templates for 23 languages, frameworks, operating systems, and editors into one file you can copy or download, without duplicate lines.
How it works
Each option is a short, hand-picked list of ignore patterns. Node, React, macOS, and VS Code are selected by default. Clicking a chip toggles it on or off, and the preview rebuilds immediately.
Selected templates are joined in the order you selected them, each under a heading comment such as # Node, with a blank line between sections. Patterns are copied as written, so if two templates both ignore node_modules/ or .env, the line appears twice. That is harmless, since Git simply applies the same rule again.
How to use
- 1
Review the default selection (Node, React, macOS, VS Code) and click any chip to turn it off.
- 2
Click the chips under Languages, Frameworks, and OS / Editors that match your project.
- 3
Check the .gitignore preview below.
- 4
Click Copy all or Download and save the file as .gitignore in your repository root. The page link keeps your selection.
Worked examples
Python project on Windows
A data script developed in a virtual environment on Windows.
Next.js app on a Mac
A new Next.js site edited in VS Code.
The VS Code rules ignore the folder but use ! to keep shared settings and recommended extensions in the repo.
Frequently asked questions
Can I combine rules for multiple frameworks?+
Yes. Select as many templates as you like and they are combined into one file, each under its own comment heading.
What happens if a file is already tracked by Git before I add it to .gitignore?+
Ignore rules only affect untracked files. Stop tracking an existing file with git rm --cached <file>, then commit; the file stays on disk and is ignored from then on.
Where do I put the .gitignore file?+
Save it as .gitignore in the root folder of your repository. You can add more .gitignore files in subfolders for rules that apply only there.
Why is node_modules/ missing from the React section?+
A rule that an earlier template already added is left out of later sections, so each line appears only once. Here node_modules/ is already in the Node section.
Should .env be ignored?+
Yes. .env files usually hold secrets such as API keys and passwords. Most templates here ignore it; commit a .env.example with empty values instead.