Build a .gitignore by combining languages, frameworks, editors and operating systems, then test which files each rule ignores, with the line that decided.
Ready-made templates to build the file and a tester that shows which line decides each path.
A .gitignore tells Git which untracked files to leave alone: installed dependencies, build output, logs, secrets and whatever your editor or operating system creates. This tool has two halves. The generator combines templates from the github/gitignore repository (public domain, CC0-1.0); there are 151 of them here, covering languages, frameworks, games, editors and operating systems, with aliases to find the right one (react and vite lead to the Node template, django to Python). Rules repeated across templates are removed without changing the outcome, and each template keeps its section comments. The tester takes a .gitignore and a list of paths (output of git ls-files, find or the tree command) and shows, for each path, whether it is ignored and which line decided.
Matching follows the Git documentation (git-scm.com/docs/gitignore): the last matching rule wins; a trailing slash limits the rule to folders; a leading or middle slash anchors the pattern to the .gitignore folder; * does not cross slashes, but ** does when it fills a whole segment; and a ! negation cannot re-include a file whose folder is excluded, because Git never descends into it. The matching code is a port of Git's wildmatch, and the tests compare its output with git check-ignore from version 2.43 across 59 rule sets and 58 paths. Everything runs in the browser: your files and paths never leave the device.
A reminder that saves time: a .gitignore only applies to files Git does not track yet. If a file was already committed, it keeps showing up even after it enters the .gitignore, and the fix is git rm --cached. Ignoring a secret also does not erase it from history: if a key was committed, rotate the key.
How to use
Pick the stack, copy the file, check the result.
Tap the shortcut for your stack (Next.js, Python, Laravel, Unity...) or search templates by name and add your editor and operating system. Add custom rules if you need them.
Copy or download the .gitignore and save it at the repository root. If you like, also grab the .gitattributes and .dockerignore starting points.
In the Test tab, paste your paths (git ls-files, find or tree) to see what stays out, which line decided each case and the linter warnings.
Embed
Use this tool on your site
Paste the code into your HTML and the tool shows up on your page, without J-Kit's navigation and ads. It still runs in the browser of whoever visits your site.
<iframesrc="https://jkit.tools/embed/en-US/gitignore-generator"width="100%"height="600"style="border:0"loading="lazy"referrerpolicy="no-referrer-when-downgrade"title=".gitignore Generator and Tester"></iframe><p style="font-size:12px;margin:6px 0 0">Tool by <a href="https://jkit.tools/en/tools/gitignore-generator">J-Kit</a></p>
Cite
Cite or link to this tool
Using it in a paper, class or post? Copy the link or a ready-made reference. The access date is today's.
<a href="https://jkit.tools/en/tools/gitignore-generator">.gitignore Generator and Tester</a>
References
Sources and references for this tool
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
Tap the shortcut for your stack (Next.js, Python, Laravel, Unity and others) or search by name: react and vite open the Node template, django opens Python. Add the editor (Visual Studio Code, JetBrains) and the operating system (macOS, Windows, Linux) of the people working on the project, copy the result and save it as .gitignore at the repository root. Editor and OS templates can also go to a global file (core.excludesFile) so they do not clutter the project.
# Normalize line endings: Git detects text files, LF in the repository.
* text=auto eol=lf
# Shell scripts need LF; Windows scripts need CRLF.
*.sh text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# Binary files: no conversion and no text diff.
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.webp binary
*.pdf binary
*.zip binary
*.gz binary
*.woff binary
*.woff2 binary
# Lock files: GitHub collapses them in diffs.
package-lock.json linguist-generated
yarn.lock linguist-generated
pnpm-lock.yaml linguist-generated
Is the file still showing up in Git?
.gitignore only applies to files Git does not track yet. To stop tracking without deleting from disk: