🚫.gitignore Generator & Tester - 40 Templates Online
Writing a .gitignore is usually the first thing you do in a new repository: dependencies, build output, logs, environment files, IDE settings and OS clutter should never be committed. Pick your stack here and get a merged .gitignore. There are 40 concise, hand-curated templates covering languages (Node.js, Python, Java, Go, Rust, C/C++, .NET, R, Swift, LaTeX), frameworks and platforms (Android, iOS, Flutter, Unity, Unreal, Laravel, Django, Rails, Next.js, Vite, Nuxt, Hugo, Jekyll, WordPress), build tools and package managers (Gradle, Maven, Composer, Yarn, pnpm, Bun, Deno, Docker, Terraform, Jupyter), editors (JetBrains, VS Code, Vim, Emacs) and operating systems (macOS, Windows, Linux). Selected templates are merged in the order you pick them, each under a ### Name ### header; duplicate rule lines are removed (unless a ! rule appeared in between, so precedence never changes), and your own rules can be appended at the end before you copy or download the file. The tester below checks paths with git’s real semantics — *, ? and [a-z] wildcards, leading and middle **, trailing / for directories only, anchoring when a pattern contains /, ! negation and the rule that files inside an ignored directory cannot be re-included — and shows which line decided the result. The matcher was verified against git ls-files output.
Free · No sign-up · Runs in your browserLast updated:
How to use .gitignore Generator
- 1Search and click the language, framework, tool, editor and OS templates you use (or pick a popular combo)
- 2Keep deduplication on, append custom rules, then copy or download .gitignore
- 3Paste file paths into the tester to see which are ignored and by which rule
FAQ
- Why is a file still committed after adding it to .gitignore?
- .gitignore only affects untracked files. Remove an already committed file from the index with git rm -r --cached <path> (the file stays on disk) and commit; from then on it is ignored.
- Why doesn’t !logs/keep.txt work?
- Once git ignores a directory it never looks inside it, so after logs/ a rule like !logs/keep.txt cannot re-include the file. Use logs/* together with !logs/keep.txt, or re-include the directory first with !logs/. The tester flags this case as “parent directory is ignored”.
- What is the difference between build, build/ and /build?
- build matches a file or directory named build at any depth; build/ matches directories only; /build matches only at the repository root. A pattern with a slash in the middle, such as docs/build, is also anchored to the root — write **/docs/build to match it at any depth.
- Are these the same as GitHub’s official templates?
- Not exactly. They are condensed from the official templates and common practice, keeping the rules most projects need so they stay easy to read and edit; add anything else as custom rules. Generation and testing run locally in your browser.