.gitignore Generator
Tick the languages, frameworks and tools you use, and get a ready-made .gitignore.
What .gitignore does
A .gitignore file tells Git which files not to track, such as dependencies, build output, editor settings and secrets.
Choose your stack
Pick any combination of Node, Python, Java, macOS, Windows, VSCode, IntelliJ, React, Next.js and Docker and the rules are combined into one file.
How to use it
- Tick your technologies.
- Press Generate.
- Press Copy and save it as
.gitignorein your project root.
Common use cases
- Starting a new repository.
- Adding missing rules to an existing project.
- Keeping editor and operating-system files out of Git.
What each template contains
The output is each ticked template under a heading like ### Node ###, separated by blank lines. The ten templates are deliberately short, so know what is inside before you commit it:
- Node:
node_modules/, npm and yarn debug logs,dist/,build/,.envand.env.local. - Python:
__pycache__/,*.py[cod],*.egg-info/,.venv/,venv/,.pytest_cache/,dist/,build/. It does not ignore.env. - Java:
*.class,*.jar,*.war,target/,.gradle/,build/. - React:
build/and the environment-specific.env.*.localfiles, but not plain.env. - Next.js:
.next/,out/andnext-env.d.ts. - Docker: only
*.pidanddocker-compose.override.yml. It does not create a.dockerignore. - VSCode: ignores
.vscode/*but keepssettings.json,tasks.jsonandlaunch.json.
Check these before committing
Ticking several templates produces duplicate lines such as build/ and dist/. Duplicates are harmless, so remove them only for tidiness. More important is the secrets gap: only the Node template ignores .env. A Python or React project would commit it unless you add the line yourself. The Java template ignores every *.jar, which also hides gradle/wrapper/gradle-wrapper.jar, a file you normally do want committed; add !gradle/wrapper/gradle-wrapper.jar afterwards.
Lock files such as package-lock.json are intentionally not ignored, and you should commit them. Languages not in the list (Go, Rust, PHP, .NET and others) need their own entries.
After you save the file
Rules apply only to untracked files. If something like node_modules was already committed, run git rm -r --cached node_modules and commit, which removes it from the index but keeps it on disk. To find out why a path is or is not ignored, run git check-ignore -v path/to/file, which prints the rule and the line that matched. Order matters within a file: a later ! negation re-includes a path ignored above, but only if its parent directory is not itself ignored.
For editor and OS files that belong to you rather than the project, such as .DS_Store, consider a personal global ignore file instead of every repository: git config --global core.excludesFile ~/.gitignore_global. The macOS and Windows templates still make sense in shared projects where teammates use those systems.
Frequently asked questions
Where does the file go?
In the root of your repository, named .gitignore.
Does it remove files already committed?
No. Ignoring only affects untracked files; use git rm --cached for files already tracked.
Should I ignore secrets?
Yes. Keep .env files and keys out of version control.
Is my data uploaded?
No. This tool runs entirely in your browser, so what you type or paste is not sent to our servers.
Why is .env not ignored in my Python project?
The Python template does not include it. Only the Node template lists .env. Add .env to the file yourself when you pick other templates.
Does it generate a .dockerignore?
No. The Docker option only adds a couple of Docker-related lines to .gitignore. Create a .dockerignore file separately.