.gitignore generator

Combine language presets and common OS junk files.

Overview

Linus Torvalds created Git in April 2005 in just a few weeks of intense work, after BitKeeper revoked the free license the Linux kernel project had been using. The name `git` is British slang for a stupid or unpleasant person — and Torvalds leaned into that, saying without irony that he is an egotistical bastard who names all his projects after himself: first Linux, now git. Git solved a real problem that CVS and SVN had: painful merges and corrupted history in distributed projects. But from the very first commits, a recurring issue appeared: files that should never be versioned — build artifacts, cache directories, OS temporary files, and worst of all, files containing credentials and passwords — ended up in the repository by mistake. The `.gitignore` file was the elegant solution to that problem.

The `.gitignore` syntax uses glob patterns: `*` matches any character sequence within a path segment, `**` matches recursively across all directories, `?` matches exactly one character, and `[abc]` matches one of the listed characters. A line starting with `!` negates the pattern — useful for ignoring an entire folder except a specific file. `.gitignore` works in cascade: you can have one at the repository root and others in subdirectories, and each one applies from where it lives. Beyond the committed `.gitignore`, there is `.git/info/exclude` (local, not committed) and `~/.gitignore_global` (applies to all repositories for a user). A classic trap: adding `node_modules/` to `.gitignore` after you have already committed that folder does not work — you need to run `git rm -r --cached node_modules` to remove it from tracking without deleting the files.

GitHub maintains an official repository with `.gitignore` templates for hundreds of languages and frameworks — originally created by Zach Holman in 2010, now with over 500 contributors. Each language has its template: Node.js ignores `node_modules`, `dist`, and `.env`; Python ignores `__pycache__`, `.pyc` files, and `venv/`; Java ignores `*.class`, `target/`, and `.gradle/`; macOS contributes `.DS_Store` and Windows its `Thumbs.db`. For polyglot projects — a monorepo with a Node.js frontend, Python backend, and Terraform infrastructure, for example — combining multiple templates is the natural approach. This tool generates the content based on those consolidated templates, letting you combine languages, frameworks, and operating systems into a single ready-to-use file.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Download — Use "Baixar arquivo" para obter um .gitignore pronto para colar no repositório.

Tool guide

  • What .gitignore is A Git repo file listing path patterns Git should not track (build output, dependencies, local secrets, OS junk).

  • What the tool does Combines presets by language (PHP, Node, Python, etc.) and common OS files.

  • Why use it Start a project without committing node_modules, .env, or binaries. Always review for your team.

Code Snippets

Code example
Use "Baixar arquivo" para obter um .gitignore pronto para colar no repositório.

Download

Use "Baixar arquivo" para obter um .gitignore pronto para colar no repositório.

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.