Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Web Tools
  3. .gitignore Generator
Add to favorites

.gitignore Generator

Generate a .gitignore from 52 templates for languages, frameworks, editors and systems, and see exactly which files git will ignore or keep.

Runs locally in your browserMore web toolsJump to full guide
Related readingGit Ignore Patterns: Keeping Your Repository Clean and Secure10 min

Initializing in your browser…

You might also like

Mock Data Generator

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.

Password Generator

Make random passwords in one click, with the strength in bits calculated from the settings and the time each would take to guess.

CSS Box Shadow Generator

Design layered CSS box shadows with live preview on light or dark, twelve presets, inset shadows, and a box-shadow line to copy.

.gitignore Generator: a worked example

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 .gitignore Generator produces

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.

About the .gitignore Generator

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.

Key features

  • 52 templates across languages, frameworks, editors, systems and tools
  • Six presets for common stacks
  • Repeated rules removed and re-inclusions placed last
  • What git does with common paths, and which line decides
  • Warnings for re-inclusions an ignored folder makes impossible
  • A path checker for any file or folder
  • Your own rules added to the file
  • Shareable link with your selection

How to use

  1. 1Pick a preset, or choose the templates for your languages, frameworks, editor and operating system.
  2. 2Add any rules of your own, one pattern per line.
  3. 3Check the panel under the file to see which paths are ignored or kept, and why.
  4. 4Type any path into Check a path to test it.
  5. 5Copy the result into .gitignore, or download it and rename it to .gitignore.

How .gitignore files work, and where they go wrong

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.

Examples

  • A Node.js project on a Mac

    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.

  • A Python service in Docker

    Use the Python Backend preset, then check a path such as data/raw.csv to see whether it would be committed.

  • Keeping one file from an ignored folder

    Add config/* and !config/default.json rather than config/ and !config/default.json; the tool flags the second form, which cannot work.

Tips & best practices

  • Add a .gitignore before your first commit; removing files from history later is much harder.
  • Always ignore .env files, and commit a .env.example with the variable names but no secrets.
  • Keep editor and system rules, like .vscode or .DS_Store, in your global gitignore if you prefer.
  • Use the path checker before committing a large folder you are unsure about.

Frequently asked questions

Where does the .gitignore file go?

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.

Why was my download saved as gitignore without the dot?

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 file is still tracked after I added it to .gitignore. Why?

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.

Should lock files be ignored?

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.

Why can't I re-include a file inside an ignored folder?

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.

Does the order of templates matter?

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.

Related tools and how they differ

  • Robots.txt Generator: Writes the other small file every site needs, for search engine crawlers.
  • Mock Data Generator: Makes test data you can keep out of the repository with a custom rule.
  • JSON Formatter & Validator: Tidies configuration files before you commit them.

Further reading

  • Git Ignore Patterns: Keeping Your Repository Clean and Secure10 min read

Private by design

This runs as client-side JavaScript. Keys, tokens, payloads, and other inputs never leave your device.