BackendBench
Coffee
Free tool

.gitignore generator

Tick your languages, build tools, IDEs and operating systems and copy one clean .gitignore.

Languages
Build tools
Frameworks and tools
Editors and IDEs
Operating systems

.gitignore

A .gitignore that matches your stack

Committing the wrong files is easy and expensive: a target/ directory with thousands of class files, node_modules, an IDE's personal settings, or worse, an .env file with credentials that now lives in your history forever. A good .gitignore on day one prevents all of that.

Tick the templates for your project (Java, Maven or Gradle, Spring Boot, Node, Python, IntelliJ, VS Code, macOS and so on) and the generator combines them into one file with a heading per section. Rules that appear in several templates are written once, and negation rules (!) are kept in order so wrapper jars stay tracked. Add your own lines at the bottom. The Secrets and env files template ignores .env, key files and credentials while keeping .env.example.

If something was already committed

The templates are written from common community conventions rather than copied wholesale, and you should adapt them to your repository. Everything is generated in your browser.

Frequently asked questions

What does a .gitignore file do?

It lists patterns of files and folders that Git should not track: build output, dependencies, logs, editor settings and secrets. Files already committed stay tracked until you remove them with git rm --cached.

How do patterns work?

target/ ignores a folder, *.log ignores by extension, a leading / anchors to the repository root, ** matches across folders and a leading ! re-includes something that an earlier rule ignored.

I added a file to .gitignore but Git still shows it.

Git only ignores untracked files. Run git rm --cached path (or git rm -r --cached folder) to stop tracking it, then commit; the file stays on disk.

Should the IDE folder be ignored?

Usually yes (.idea/, .vscode/ settings that are personal). Teams often keep a few shared files, which the VS Code template does with ! rules for settings.json and launch.json.

More tools you might need