🙈 .gitignore Generator
Check off the languages, frameworks and tools your project uses and get a combined
.gitignore file, deduplicated and ready to paste.
How the templates are combined
There are fourteen short templates - Node, Python, Java, Maven, React, macOS,
Windows, Linux, VS Code, JetBrains, Docker, Terraform, Logs and Environment Files -
and the ones you tick are concatenated in that order. Any pattern already emitted by
an earlier section is dropped, matching on the exact line, while #
headings are always kept. Tick Node and React together and React shrinks to what Node
did not already cover:
# React
.env.development.local
.env.production.local
These are compact starting points rather than copies of the long github/gitignore files, so add anything your build produces that is missing.
Reading the patterns
- A trailing slash means directory only.
build/ignores the folder anywhere in the tree but leaves a file calledbuildtracked;*.logwith no slash matches at every depth. - The last matching line wins. That is why Environment Files ends
with
!.env.example, re-including one file after.env.*hid it. A negation cannot rescue anything inside an ignored directory, though - unignore the directory first.
Frequently asked questions
Why is git still tracking a file after I added it to .gitignore?
Because the file is already committed, and .gitignore only applies to untracked
files. Run git rm --cached path/to/file, then commit - the file stays on
disk and leaves the index.
Should .gitignore be committed to the repository?
Yes. It is shared project configuration, and everyone cloning needs the same rules.
Keep purely personal entries out of it and put them in
.git/info/exclude, or in a global file set with
core.excludesFile.
A secret was committed before I ignored it - is deleting it enough?
No. The value stays in the history for anyone who clones. Rotate the credential first, then rewrite the history with git filter-repo or BFG if the repository is public.