What it does
The .gitignore generator builds a .gitignore file for your repository by combining ready-made templates. Pick the languages, frameworks, build tools, game engines, editors and operating systems your project touches, and the tool merges their rules into one file with a ### Name ### heading per section, ready to copy or download.
The bundled set covers about sixty templates from the github/gitignore collection: Node.js, Python, Java, Go, Rust, .NET, Swift, PHP frameworks such as Laravel and Symfony, Next.js, Flutter, Android, Terraform, Unity, Unreal Engine, Godot, VS Code, JetBrains IDEs, Vim, Emacs, macOS, Windows, Linux and more. Everything runs in your browser; no request is sent anywhere.
How to use
- Click templates in the list to add them. Use the search box to find one quickly; it also matches common aliases, so “typescript” finds Node.js and “intellij” finds JetBrains.
- Selected templates appear as chips at the top, in the order you picked them, and the file follows that order. Click a chip to remove it, or Clear to start over.
- Add project-specific entries under Custom rules, separated by commas, for example
.env, /dist, *.local. They are appended at the end in a### Custom ###section. - Choose whether to keep the explanatory comments from the templates and whether to remove rules that an earlier template already listed.
- Copy the result or download it. The download is named
.gitignore; save it in the root of your repository.
The selection is stored in the page address, so you can bookmark or share a link that reproduces the same file.
Example
Selecting Node.js, macOS and VS Code with the custom rule .env.local and comments turned off produces a file like this (shortened):
### Node.js ###
logs
*.log
npm-debug.log*
…
node_modules/
…
### macOS ###
.DS_Store
.AppleDouble
.LSOverride
…
### VS Code ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
!*.code-workspace
*.vsix
### Custom ###
.env.local
Patterns that start with ! re-include something an earlier rule excluded; here the shared VS Code settings, tasks and launch configurations stay in the repository while personal editor state is ignored. Adding .env as a custom rule would change nothing, because the Node.js template already lists it.
Tips
- Put rules for your personal tools (editor swap files, OS metadata) in a global excludes file so every repository benefits without each project listing them.
- A trailing slash such as
build/matches only directories; a leading slash such as/buildanchors the rule to the repository root. - Use
git check-ignore -v <path>to see which line of which ignore file matches a path. - Never rely on .gitignore to protect secrets that are already committed: rotate them and rewrite history instead.
FAQ
› Where do the templates come from?
They are bundled copies of the official github/gitignore collection, which GitHub publishes under the CC0 public-domain dedication. Nothing is downloaded when you use the tool; the templates ship with the page.
› Why is a file still tracked after I added it to .gitignore?
.gitignore only affects untracked files. If a file was committed before, remove it from the index with git rm --cached <file> (or -r for a folder) and commit; the file stays on disk and is ignored from then on.
› What does Remove duplicate rules do?
Many templates share rules: Java and Kotlin both ignore *.class, C and C++ both ignore *.o. With the option on, a rule is written only the first time it appears, and a comment heading whose rules were all removed is dropped too. Turn it off to get each template exactly as published.
› Should I commit the .gitignore file?
Yes. A committed .gitignore applies to everyone who clones the repository. Rules that only concern your own machine, such as your editor or OS, can also go in a global excludes file (git config --global core.excludesFile ~/.gitignore_global) instead.