induwara.lk
induwara.lkDeveloper · Git

.gitignore Generator

Build a clean, deduplicated .gitignore from 23+ of GitHub's own official templates. Pick your languages, frameworks, editor and OS, then copy or download in one click. Runs entirely in your browser — no signup, no upload, sources cited.

By Induwara AshinsanaUpdated Jun 23, 2026
Build your .gitignore
github/gitignore · CC0 · @dcc0fc7
Quick stacks

Type to filter the template list below by name.

Selected (3)
NodeVisual Studio CodemacOS

Languages

Frameworks

IDEs & Editors

Operating Systems

Each non-empty line is added verbatim under a ### Custom ### section.

216 lines3.3 KB3 templates
.gitignore
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist
.output

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp directory
.temp

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# pnpm
.pnpm-store

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vite/

### Visual Studio Code ###
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
!*.code-workspace

# Built Visual Studio Code Extensions
*.vsix

### macOS ###
# General
.DS_Store
.localized
__MACOSX/
.AppleDouble
.LSOverride
Icon[
]

# Resource forks
._*

# Files and directories that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.com.apple.timemachine.supported
.PKInstallSandboxManager
.PKInstallSandboxManager-SystemSoftware
.hotfiles.btree
.vol
.file
.disk_label*
lost+found
.HFS+ Private Directory Data[
]

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Mac OS 6 to 9
Desktop DB
Desktop DF
TheFindByContentFolder
TheVolumeSettingsFolder
.FBCIndex
.FBCSemaphoreFile
.FBCLockFolder

# Quota system
.quota.group
.quota.user
.quota.ops.group
.quota.ops.user

# TimeMachine
Backups.backupdb
.MobileBackups
.MobileBackups.trash
MobileBackups.trash
tmbootpicker.efi

Templates are copied verbatim from github/gitignore @dcc0fc7, dedicated to the public domain under CC0-1.0. Everything runs in your browser — nothing is uploaded. View the source collection.

How it works

A .gitignorefile tells Git which paths to leave untracked, so generated junk and secrets never reach your history. Each line is a glob pattern matched against paths relative to the file's location. A trailing /means “directory”; * matches anything except a slash; ** matches across directories; a leading ! re-includes a previously ignored path; and lines starting with # are comments. The full grammar and precedence rules are defined in the official Git documentation cited below.

This tool is a deterministic template-merge engine, not a numeric calculator. It ships a version-pinned copy of 23templates taken verbatim from GitHub's public-domain github/gitignore collection — the same set behind the “Add .gitignore” dropdown when you create a repository. The build is pinned to commit dcc0fc7 so output is reproducible. Generation works in four steps:

  1. Order.Whatever order you click, selections are emitted in a stable sequence — Languages, then Frameworks, then IDEs & Editors, then Operating Systems — so the same picks always produce the same file.
  2. Assemble. For each template a ### name ### header (when grouping is on) is followed by that template's exact lines, then a blank separator. Custom rules you type are appended last under a ### Custom ### section.
  3. Deduplicate. When the toggle is on, the engine walks the merged lines top-to-bottom and keeps only the first occurrence of each identical pattern, dropping later copies and reporting the count. Comments, blank lines and negation rules (!pattern) are never treated as duplicates — removing a later negation could change which files Git ignores, so the merge preserves Git's last-matching-pattern semantics.
  4. Measure. The line count comes from content.split("\n") and the byte size from the UTF-8 length of the text, shown live in the badge row. A separate cross-check function recomputes the duplicate count independently, so the “X duplicates removed” figure is verified, not estimated.

Nothing leaves your machine: the templates are bundled, so there are no GitHub API calls, no rate limits and no upload of your selections. Place the resulting file in your repository root and commit it before adding the files you want ignored.

Worked examples

Node web app on VS Code + Windows

Node · Visual Studio Code · Windows

  1. Sections emit in fixed order: Languages → IDEs → OS.
  2. ### Node ### block: node_modules/, dist/, .env, *.log …
  3. ### Visual Studio Code ### block: .vscode/* with the !.vscode/settings.json negation kept intact.
  4. ### Windows ### block: Thumbs.db, Desktop.ini, $RECYCLE.BIN/ …
  5. No pattern is shared across the three files → 0 duplicates removed, 183 lines total.

Python — custom rule that duplicates a template line

Python + custom rule “__pycache__/”

  1. Python’s official template already contains __pycache__/.
  2. Your custom rule repeats it under the ### Custom ### section (added last).
  3. With “remove duplicates” on, the later copy is dropped.
  4. Result: 1 duplicate removed, __pycache__/ appears exactly once.
  5. Turn the toggle off and both copies are kept (0 removed) — your choice.

Full-stack: Python + Node + VS Code + macOS

Python · Node · Visual Studio Code · macOS

  1. Two languages, one IDE, one OS merged into a single file.
  2. Order is deterministic regardless of the click sequence.
  3. Each block keeps its own comments so the file stays readable.
  4. Duplicate patterns across Python/Node (e.g. *.log) are collapsed once.
  5. Copy or Download → drop into your repo root before the first commit.

Frequently asked questions

Sources & references

Bundled templates were last cross-checked against github/gitignore at commit dcc0fc7 on 2026-06-23. The pinned commit is refreshed periodically as GitHub updates the upstream templates.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, want another template bundled, or have an edge case?

Email me at [email protected] — most fixes ship within 24 hours.