.gitignore Generator
About this tool
About .gitignore Generator
Start a repository with a .gitignore that already covers your stack. The 31 templates are shown as cards with a peek at their first rules: languages, frameworks, platforms, editors and tooling such as Node, Python, Go, Rust, .NET, Next.js, Django, Flutter, Android, iOS, Unity, Terraform, Docker, macOS, Windows, JetBrains IDEs and VS Code. Tap as many as you need and the generator merges them into one file with a header per template. Patterns that appear in more than one template, like node_modules/, *.log or .env, are written only once, and a comment is dropped when every pattern under it was already covered, so the file stays short and readable. Filter the cards by group, search by alias (intellij finds JetBrains, golang finds Go), start from a stack preset, add your own lines at the end, and switch headers or comments off for a compact file. Everything is bundled with the page, so the file is built instantly and offline. With your own AI key, you can also describe your stack and AI picks the matching templates plus a few extra patterns.
Built and maintained by Abhi JainUpdated
How to Create a .gitignore File
- 1
Choose templates
Tap the template cards for the languages, frameworks, platforms and editors you use, filter or search them, or pick a stack under Stacks.
- 2
Add your own lines
Type project-specific patterns in Custom patterns; they are added last.
- 3
Tidy the output
Turn Section headers and Keep comments on or off. The counter shows how many duplicates were removed.
- 4
Save it
Click Download or Copy and save the file as .gitignore in the root of your repository.
.gitignore Generator: questions and answers
Why is git still tracking a file I added to .gitignore?
.gitignore only affects untracked files. If the file was committed before, run git rm --cached <file> (add -r for a folder), then commit. The file stays on disk but git stops tracking it.
Should I commit the .env file?
No. .env files usually hold passwords and API keys. The Env files & secrets template and most language and framework templates ignore .env and .env.* but keep .env.example, so you can commit a sample with placeholder values that shows which variables are needed.
Should package-lock.json or Cargo.lock be ignored?
Commit lock files for applications so every install gets the same dependency versions. For Rust libraries, Cargo.lock has traditionally been left out; the Rust template mentions this as a commented line you can enable.
Which .gitignore templates are included?
31 templates written for this tool: 11 languages (Node, Python, Java, Kotlin, Go, Rust, C/C++, .NET, Ruby, PHP, Swift), 5 frameworks (Flutter/Dart, Next.js, React/Vite, Angular, Django), 6 platforms (Android, iOS, Unity, macOS, Windows, Linux), 6 editors (JetBrains, VS Code, Vim, Emacs, Eclipse, Sublime) and 3 tooling sets (Terraform, Docker, env files and secrets). Pick several and they are merged without duplicates; a ! line in Custom patterns re-includes a file a template ignores.
How do I ignore files only on my machine?
Add them to .git/info/exclude in the repository, or set a global ignore file with git config --global core.excludesFile ~/.gitignore_global. Neither is shared with others.
Can AI help me pick .gitignore templates?
Yes, optionally. Click AI and describe your stack; it picks only from the templates bundled here and may add a few extra patterns, which you review before applying. Only your description and the list of template names are sent. It uses the AI provider and key you connect in AI settings (Claude, OpenAI, Gemini, DeepSeek, OpenRouter or a compatible endpoint), and the request goes straight from your browser to that provider; KissThePDF has no server in between.
Related Tools
- Git Cheat SheetSearchable git commands by task, with undo recipes for the mistakes everyone makes.
- Git Branch Name GeneratorTurn a ticket and title into a clean, valid git branch name, and check any name against git's rules.
- Conventional Commit GeneratorWrite Conventional Commits messages with type, scope, breaking changes and footers, checked as you type.
- GitHub URL ParserSplit GitHub URLs into owner, repo, branch and path, and get raw, clone, ZIP and CDN links.