Free .gitignore Generator
Generate .gitignore files for any programming language or framework. Free, fast, and works entirely in your browser with no sign-up required.
Updated
.gitignore Generator
Generate comprehensive .gitignore files for 50+ languages, frameworks, and tools.
Quick Start: Stack Presets
Select Templates (2)
.gitignore29 rules
# ========================================== # Node.js # ========================================== node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* .pnpm-debug.log* dist/ build/ .env .env.local .env.*.local .idea/ .vscode/ *.swp *.swo .DS_Store Thumbs.db logs/ *.log coverage/ .nyc_output/ # ========================================== # macOS # ========================================== .AppleDouble .LSOverride Icon ._* .Spotlight-V100 .Trashes .fseventsd .VolumeIcon.icns .com.apple.timemachine.donotpresent
About .gitignore Patterns
Pattern Syntax
*matches anything except /**matches everything including /?matches any single character[abc]matches one of the characters
Special Patterns
/at start = relative to root/at end = directories only!negates a pattern (unignore)#starts a comment
Frequently Asked Questions
What is the .gitignore Generator?
The .gitignore Generator is a free online tool that creates .gitignore files with the right rules for any programming language, framework, or IDE.
Is the .gitignore Generator free?
Yes, it is completely free with no registration required. All file generation happens client-side in your browser.
What languages and frameworks are supported?
The .gitignore Generator supports templates for Node.js, Python, Java, Go, Rust, React, Angular, Vue, and dozens of other languages and frameworks.
Is my data safe with this tool?
Absolutely. The .gitignore Generator processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.
Does the .gitignore Generator work on mobile devices?
Yes, the .gitignore Generator is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.
Do I need to create an account to use this tool?
No account or registration is needed. Simply open the .gitignore Generator in your browser and start using it immediately. There are no sign-up walls or usage restrictions.
How do I use the .gitignore Generator?
Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.
Which browsers are supported?
The .gitignore Generator works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.
Why is my .gitignore not ignoring a file that's already been committed?
A .gitignore only affects untracked files. Once Git is already tracking a file, adding a matching pattern does nothing — Git keeps watching it because it is part of the index. To fix this, stop tracking the file while leaving it on disk with git rm --cached path/to/file, or git rm -r --cached folder/ for a directory, then commit the change. The file now becomes untracked and the ignore rule takes effect. This commonly happens with a .env file, a build folder, or node_modules/ that slipped in before you added any rules. Note that the file stays in your project history even after removal, so a committed secret should also be rotated rather than just ignored. Generate your ruleset here first, paste it into the repository, and use the built-in path tester to confirm the pattern matches before you run the cleanup commands.
What is the difference between *, **, and a trailing slash in gitignore patterns?
These control how broadly a pattern matches. A single asterisk (*) matches any characters except a directory separator, so *.log catches build.log but not logs/app.log. A double asterisk (**) matches across directories, so logs/**/debug.log reaches any depth. A trailing slash like build/ targets directories only, ignoring a folder and everything inside it while leaving a file named build untouched. A leading slash anchors a pattern to the repository root, so /config matches only the top-level config, not nested ones. A ? matches exactly one character, and [abc] matches one listed character. A leading ! negates an earlier rule so you can un-ignore a single file, and lines starting with # are comments. This generator's templates already use these correctly, and the Pattern Reference tab summarizes each one. Build your file above and test a sample path to see exactly which rules apply.
How do stack presets like MERN and LAMP work in this generator?
Stack presets are one-click shortcuts that load a curated set of templates for a common technology combination, so you skip hunting through the list. Selecting MERN selects Node.js, React, MongoDB, macOS, and VS Code at once, while LAMP loads PHP, Laravel, macOS, and Linux. There are eight presets in total, also covering Python ML, Flutter, Full Stack JS, Java Spring, Go API, and Rust. Each preset replaces your current selection rather than adding to it, giving you a clean starting point. After applying one you can still toggle individual templates on or off, add custom rules below, and remove any template badge you do not need. Presets are the fastest route when your project matches a standard stack; choose one above, then refine the output panel until the file fits your repository exactly.
Should OS and editor files like .DS_Store go in a project .gitignore or a global one?
Files created by your operating system or editor — .DS_Store on macOS, Thumbs.db on Windows, or .idea/ and .vscode/ folders — are personal to your machine, not your project. Putting them in a shared project .gitignore works, but it clutters the file and assumes every teammate uses the same OS and editor. A cleaner approach is a global gitignore that applies to every repository on your computer. You set it up once with git config --global core.excludesfile ~/.gitignore_global, then add your OS and editor patterns to that file. This generator surfaces that exact command under its Global config option, and individual OS and IDE templates here let you copy the relevant patterns into your global file. Generate the patterns above, then decide which belong in the project file versus your global one.
Is the path tester in this tool as accurate as real Git matching?
The built-in path tester gives a fast, useful approximation but is not a full reimplementation of Git's matching engine. You type a file path such as src/node_modules/test.js, and it instantly shows whether your current rules would mark it Ignored or Not ignored, which is great for sanity-checking a pattern before you commit. Under the hood it uses simplified matching rather than the complete gitignore specification, so unusual edge cases — complex negations, certain bracket expressions, or precedence between overlapping rules — may not resolve exactly as Git does. For everyday patterns like folders, extensions, and wildcards it is reliable. When a result surprises you, confirm with git status or git check-ignore in your actual repository. Build your ruleset above, run a few representative paths through the tester, then verify anything critical in Git itself.
Related Tools
Free API Tester Online
Test REST APIs with GET, POST, PUT, DELETE requests. Free, fast, and works entirely in your browser with no sign-up required.
Free cURL to Code Converter
Convert cURL commands to code in JavaScript, Python, PHP. Free, fast, and works entirely in your browser with no sign-up required.
Free JSON Schema Generator
Generate JSON Schema from your JSON data automatically. Free, fast, and works entirely in your browser with no sign-up required.
Free HTTP Headers Parser
Parse and analyze HTTP headers from requests and responses. Free, fast, and works entirely in your browser with no sign-up required.
About the .gitignore Generator
The .gitignore Generator is a free tool that builds a ready-to-use .gitignore file for whatever you're working on. Pick the languages, frameworks, tools, and editors in your project, and it stitches together a clean, commented file that tells Git which files to leave out of version control. It's built for developers who want a sensible starting point without copying snippets from a dozen browser tabs — useful at the very start of a repo, when you switch stacks, or when you finally clean up a project that has been committing junk for months.
Everything runs in your browser. The templates ship with the page, so nothing you select and no custom rule you type is sent to a server — there is no sign-up, no API key, and no account. You can generate, copy, and download a file completely offline once the page has loaded.
How to build your .gitignore
You start by choosing templates, which are grouped into collapsible categories — Language, Framework, Tool, Service, Database, OS, IDE, and more. There are over 50 in total, covering Node.js, Python, Java, Go, Rust, C#, PHP, Ruby, React, Next.js, Vue, Angular, Django, Laravel, Terraform, Docker, and many others. A search box filters the list as you type, and each selection appears as a removable badge so you always know what's included.
To skip the picking entirely, use a stack preset. One click loads a curated combination — for example, MERN selects Node.js, React, MongoDB, macOS, and VS Code, while LAMP loads PHP, Laravel, macOS, and Linux. Presets exist for Python ML, Flutter, Full Stack JS, Java Spring, Go API, and Rust as well.
As you select, the output panel rebuilds in real time. Each template is written under a clear comment header, a running count shows how many active rules you have, and a "Remove duplicates" option collapses identical patterns that appear across multiple templates so the file stays tidy. When you're happy with it, copy it to your clipboard or download it straight as a .gitignore file.
Custom rules and pattern testing
Below the templates is a free-form area for project-specific rules — a build folder, a secrets file, a generated artifact. Entries are checked as you type, flagging things like stray control characters, and an "Add !pattern" helper inserts a negation so you can un-ignore a single file inside an ignored folder.
A built-in path tester lets you type a file path, such as src/node_modules/test.js, and instantly see whether your current rules would ignore it. This is handy for confirming a pattern does what you expect before you commit, though it uses simplified matching rather than the full Git specification.
Why a .gitignore matters
A .gitignore file lists patterns for files Git should not track. Without one, repositories quickly fill with dependency folders like node_modules/, build output, editor settings, OS clutter such as .DS_Store and Thumbs.db, and — most dangerously — secrets like a .env file. Once a secret is committed, it lives in your history even after deletion, so keeping it out from the start is the only clean fix.
A few patterns worth knowing: * matches anything except a slash, ** matches across directories, a trailing / targets directories only, a leading / anchors to the repo root, and ! negates an earlier rule. The generator also surfaces the git config --global core.excludesfile ~/.gitignore_global command, the standard way to keep personal OS and editor patterns out of every project's shared file.
Choose your templates above to generate a complete .gitignore, then copy or download it into the root of your repository.