.gitignore Generator
Build a .gitignore file by checking the languages, frameworks and editors you use — Node.js, Python, Java, macOS, Windows, VS Code and more, deduplicated and ready to download.
226 views
How It Works
Check the boxes for whatever applies to your project — a language or runtime like Node.js, Python or Java, an operating system like macOS, Windows or Linux, an editor like VS Code or IntelliJ/JetBrains, plus Git's own leftover files and a block for .env and secrets. Each checkbox adds a small, well-established set of ignore patterns pulled from the conventions the community actually uses — node_modules/ for Node, __pycache__/ and .venv/ for Python, *.class and target/ for Java, .DS_Store for macOS, Thumbs.db for Windows, and so on. As you check more boxes the tool merges everything into one list, drops exact duplicates, and shows the result live in a text box you can copy or download directly as a file named .gitignore.
The reason to combine categories rather than write one from scratch is that most real projects straddle several of them at once: a Node.js API developed on a Mac in VS Code needs the Node block for build artifacts, the macOS block so .DS_Store never sneaks into a pull request, and the VS Code block so your personal editor settings do not overwrite a teammate's. Checking all three and downloading once is faster and less error-prone than hand-assembling patterns from memory or copy-pasting fragments from old projects.
Good to Know
A .gitignore file only affects files Git does not know about yet — it tells Git which untracked files to leave out of git status, git add . and future commits. It has no effect on files that are already tracked (already committed at least once). This is the single most common point of confusion: adding .env to .gitignore after it was already committed does not remove it from the repository or stop Git from tracking further changes to it. To actually untrack a file, you first need to run git rm --cached <file> (which removes it from Git's index but leaves it on disk), commit that removal, and only then does the matching .gitignore rule take over for the future.
Most of the patterns offered here trace back to GitHub's official github/gitignore repository, the most widely referenced source for language- and tool-specific templates and the same collection GitHub itself offers when you create a new repository through its web UI. Keeping dependency folders like node_modules/ and build output like dist/ or target/ out of version control matters for size — these folders can easily outweigh your actual source code many times over and are trivially regenerated from a lockfile or build script — while keeping files like .env, *.pem and *.key out matters for security: committing a secret to Git history means it is effectively public forever, since removing it from the latest commit does not erase it from earlier ones without rewriting history entirely.
Frequently Asked Questions
I added a file to .gitignore but Git is still tracking it — why?
.gitignore only stops Git from tracking files it does not already know about. If the file was committed before you added the rule, Git keeps tracking it regardless of what .gitignore says. Fix it with git rm --cached <file> (or git rm -r --cached <folder> for a directory), then commit that change — from that point on, the .gitignore rule takes effect.
Can I combine multiple categories, like Node.js and macOS and VS Code together?
Yes — that is the normal case. Check every box that applies to your setup and the tool merges all the resulting patterns into a single list, removing exact duplicates so the same line never appears twice.
Where do these ignore patterns come from?
They follow the same conventions as GitHub's official github/gitignore template repository, the standard reference most tooling and tutorials point to. These are the same file/folder patterns you would get if you generated a template through GitHub's own "Add .gitignore" option when creating a repository.
Why should node_modules/ or .env never be committed?
node_modules/ is a dependency cache that can be regenerated from package.json/package-lock.json in seconds — committing it bloats the repository with megabytes (sometimes gigabytes) of redundant files. .env is different: it typically holds API keys, database passwords or other secrets, and once a secret lands in Git history it should be considered compromised, because deleting it from the latest commit does not remove it from earlier commits — only rewriting history (and rotating the secret) actually fixes that.
Does the downloaded file need to be renamed?
No. The download button saves the file with the exact name Git expects — .gitignore, with a leading dot and no extension — so you can drop it straight into your project's root folder next to your first commit.
Similar Tools
Report a Problem
.gitignore Generator
Comments
No comments yet — be the first to write one!