Skip to main content
ToolsHub

.gitignore Generator

Select your stack — Node, Python, Java, macOS, VS Code and more — and instantly assemble a clean, deduplicated .gitignore you can copy or download. No uploads, all client-side.

Updated

Files never leave your browser

Select languages, frameworks & tools

Generated .gitignore

# Node
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
.npm
dist/
coverage/
.env
.env.local

# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.Spotlight-V100
.Trashes

How to use .gitignore Generator

The .gitignore Generator assembles a clean, deduplicated .gitignore file for any combination of languages, frameworks, editors, and operating systems — drawing from the same community-maintained templates used by GitHub's official generator. Select your stack and instantly get a file that excludes build artifacts, dependency directories, IDE settings, OS metadata, and log files, keeping your repository free of accidental noise.

  1. Type or select the languages and frameworks your project uses (e.g. Node, Python, Java, Go, React).
  2. Add any editors or IDEs on your team (VS Code, JetBrains IDEs, Vim, Emacs).
  3. Add operating systems if your team is cross-platform (macOS, Windows, Linux).
  4. Review the combined output — duplicate patterns are automatically removed.
  5. Copy the generated .gitignore content or download it as a .gitignore file.
  6. Place the file in your repository root and commit it as the first commit before adding any source files.

Your data never leaves your device — 100% private processing.

.gitignore pattern syntax

Gitignore patterns follow glob rules with a few extensions. A leading slash anchors the pattern to the repository root (e.g. /dist/ ignores only the top-level dist directory). A trailing slash matches only directories. An asterisk (*) matches anything except a slash; double asterisk (**) matches across directory separators (e.g. **/node_modules ignores node_modules at any depth). A leading exclamation mark (!) negates the pattern, re-including a file that was excluded by a previous rule. Blank lines and lines beginning with # are ignored as comments. Patterns are read top-to-bottom and the last matching rule wins for a given file.

Common .gitignore patterns
PatternWhat it ignoresUse case
node_modules/Any node_modules directory at any depthNode.js projects
*.logAll files ending in .logApplication logs
.envThe .env file in the rootSecret environment variables
.env*.local.env.development.local etc.Local environment overrides
dist/Top-level dist build directoryCompiled output
**/__pycache__/Python bytecode cache directoriesPython projects
!.env.exampleRe-includes .env.exampleSharing env templates

Global gitignore and repository-level ignore

Git supports three layers of ignore rules. The repository-level .gitignore file is the most common and should contain project-specific patterns. A global gitignore (~/.gitignore_global, configured via git config --global core.excludesfile) applies to all repositories on your machine and is the right place for editor and OS patterns (e.g. .DS_Store, Thumbs.db, .idea/). The .git/info/exclude file applies to your local clone without being committed. Already-tracked files are not ignored even if a pattern matches — you must run git rm --cached <file> to stop tracking them.

Worked examples

Ignore Node build output

Inputs: stack: Node

Result: node_modules/, dist/, .env, *.log, npm-debug.log*

Re-include one file

Inputs: *.log then !important.log

Result: ignores all .log files except important.log

Ignore at any depth

Inputs: **/__pycache__/

Result: matches __pycache__ in every directory

Glossary

.gitignore
A text file that specifies intentionally untracked files that Git should ignore.
Glob pattern
A wildcard pattern using *, ?, and ** to match file paths without a full regular expression.
Negation pattern
A .gitignore pattern starting with ! that re-includes a file previously excluded by an earlier rule.
Tracked file
A file that has been added to Git's index — gitignore rules do not affect files that are already tracked.
git rm --cached
A git command that removes a file from the index (stops tracking it) without deleting it from disk.

Related reading

Free · No spam

Get weekly tool tips & updates

New tools, power-user tips, and productivity hacks — delivered free every Friday.

No spam, ever. Unsubscribe with one click.

Related Developer Tools

Explore all Developer Tools.