Generate a .gitignore from 52 templates for languages, frameworks, editors and systems, and see exactly which files git will ignore or keep.
Initializing in your browser…
Generate realistic test data as JSON, CSV or SQL: valid card numbers and IBANs, safe example e-mails, and a seed that brings the same rows back.
Make random passwords in one click, with the strength in bits calculated from the settings and the time each would take to guess.
Design layered CSS box shadows with live preview on light or dark, twelve presets, inset shadows, and a box-shadow line to copy.
You are starting a repository for a Node.js front end with a small Python script, working on a Mac, and want one .gitignore that covers all three.
Templates chosen
Node.js, Python, macOS
What git will do, as the page reports it
69 rules over 129 lines. 5 repeated rules dropped. 1 re-inclusion moved to the end. ignored node_modules/left-pad/index.js line 8: node_modules/ ignored .env line 20: .env ignored dist/bundle.js line 14: dist/ ignored __pycache__/mod.cpython-311.pyc line 46: __pycache__/ ignored .DS_Store line 95: .DS_Store kept .env.example line 128: !.env.example kept package-lock.json no pattern matches kept src/index.js no pattern matches
Node.js and Python both ignore .env and both re-include .env.example, so five repeated rules are dropped and the single remaining !.env.example is placed at the end of the file, on line 128, after every ignore rule. That is why .env.example is kept even though .env.* above it matches. The lock file and the source code match no rule at all, so they are committed, which is what you want.
Build a .gitignore from 52 templates for languages, frameworks, editors, operating systems and tools, combine as many as you need, and add your own rules. The page shows what git will do with common paths and which line decides each one, so you can trust the file before you commit it.
What it is for. A .gitignore file tells git which files to leave out of the repository: installed dependencies, build output, logs, editor settings, operating system clutter and, most importantly, secrets such as .env files. Getting it right early keeps the repository small and stops credentials being committed by accident.
Combining templates. Pick the templates that match your project, such as Node.js, Python, VS Code and macOS, or start from a preset. The generator merges them into one file, drops repeated rules, and moves every re-inclusion (a rule starting with !) to the end. That matters because in a .gitignore the last matching rule wins: without this step, the order you happened to pick the templates in could decide whether a file is kept.
Seeing what git will do. Under the file, a panel lists common paths, such as node_modules, .env, .env.example, build output and source files, and says whether git will ignore or keep each one, with the line that decided it, the same answer git check-ignore -v gives. Lock files such as package-lock.json and Cargo.lock are kept, because they belong in the repository. Type any other path to check it too.
A trap the tool catches. A rule like !build/keep.txt cannot work if build/ itself is ignored: git never looks inside an ignored directory, so nothing in it can be brought back. The generator flags any re-inclusion that a parent directory makes impossible and suggests the pattern that does work.
Saving the file. Copy the text into a file named .gitignore at the root of your repository, or download it. Browsers drop the leading dot from downloaded file names, so rename the download to .gitignore. Your selection is kept in the page address, so a link shares the same set of templates.
Choose Node.js and macOS: node_modules, build output, logs, .env and .DS_Store are ignored, while .env.example and package-lock.json are kept.
Use the Python Backend preset, then check a path such as data/raw.csv to see whether it would be committed.
Add config/* and !config/default.json rather than config/ and !config/default.json; the tool flags the second form, which cannot work.
In the root folder of your repository, named exactly .gitignore. Subfolders can have their own .gitignore files too, which apply to that folder and below.
Browsers remove the leading dot from downloaded file names. Rename the file to .gitignore, or copy the text and paste it into a file you create.
A .gitignore only affects untracked files. Stop tracking the file with git rm --cached path/to/file, then commit; the rule keeps it out from then on.
No. package-lock.json, yarn.lock, Cargo.lock, bun.lockb and similar files record exact dependency versions and should be committed, so everyone installs the same thing.
Git does not look inside a folder that is ignored, so a later rule cannot bring a file back. Ignore the folder's contents with folder/* instead, then re-include the file.
Not here. The generator places every re-inclusion after all the ignore rules, so the result is the same whatever order you pick templates in.
This runs as client-side JavaScript. Keys, tokens, payloads, and other inputs never leave your device.