Developer

.GITIGNORE GENERATOR

Select your languages, frameworks, IDEs, and OS to generate a clean, well-commented .gitignore file.

Select your stack
Languages
Frameworks / Runtimes
IDEs & Editors
Operating Systems
Tools & Build
Generated .gitignore
Developer Reference

Core Algorithm & Standalone Script

Standalone, zero-dependency JavaScript implementation powering this tool. Free to inspect, copy, and build upon.

const templates = {
  // Languages
  node: { cat:'lang', label:'Node.js', content:`# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
.npm
.yarn-integrity
package-lock.json
yarn.lock
pnpm-lock.yaml
.node_repl_history
*.tgz
.env
.env.*
!.env.example
dist/
build/
.cache/
coverage/
.nyc_output/` },

  python: { cat:'lang', label:'Python', content:`# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
*.manifest
*.spec
pip-log.txt
pip-delete-this-directory.txt
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
.pytype/
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pyc
venv/
.venv/
env/
ENV/
.env
.env.*
!.env.example
Pipfile.lock` },

  java: { cat:'lang', label:'Java', content:`# Java
*.class
*.log
*.ctxt
.mtj.tmp/
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
hs_err_pid*
replay_pid*
target/
.classpath
.project
.settings/
bin/
out/` },

  kotlin: { cat:'lang', label:'Kotlin', content:`# Kotlin
*.class
*.log
*.jar
*.war
*.ear
target/
build/
.gradle/
local.properties
*.iml
*.ipr
*.iws
.idea/
out/
.kotlin/` },

  go: { cat:'lang', label:'Go', content:`# Go
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
go.sum
vendor/
# Go workspace
go.work
go.work.sum` },

  rust: { cat:'lang', label:'Rust', content:`# Rust
/target/
Cargo.lock
**/*.rs.bk` },

  dotnet: { cat:'lang', label:'.NET / C#', content:`# .NET / C#
*.user
*.suo
*.userosscache
*.sln.docstates
.vs/
[Dd]ebug/
[Rr]elease/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
*.pidb
*.svclog
*.scc
*.cache
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
project.lock.json
project.fragment.lock.json
artifacts/
ScaffoldingReadMe.txt
StyleCopReport.xml
*.[Cc]ache
!*.[Cc]ache/
Generated_Code/
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
packages/
!packages/build/
*.nupkg
*.snupkg
**/[Pp]ackages/*
build/
publish/` },

  php: { cat:'lang', label:'PHP', content:`# PHP
/vendor/
composer.phar
composer.lock
.phpunit.result.cache
.php_cs.cache
.phpcs-cache
*.log
.env
.env.*
!.env.example` },

  ruby: { cat:'lang', label:'Ruby', content:`# Ruby
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/
.byebug_history
.dat*
.repl_history
artifacts/
/html
/rdoc
/pkg/
/doc/
Gemfile.lock
/.bundle/
/vendor/bundle
/lib/bundler/man/
.rvmrc
.ruby-version
.ruby-gemset` },

  swift: { cat:'lang', label:'Swift / iOS', content:`# Swift / iOS
*.xcuserstate
*.xcworkspace
!default.xcworkspace
xcuserdata/
.build/
Packages/
Package.resolved
DerivedData/
*.hmap
*.ipa
*.xcarchive
*.dSYM.zip
*.dSYM` },

  flutter: { cat:'lang', label:'Flutter / Dart', content:`# Flutter / Dart
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds` },

  // Frameworks
  react: { cat:'framework', label:'React / Next.js', content:`# React / Next.js
.next/
out/
.vercel
.turbo
*.tsbuildinfo
next-env.d.ts` },

  vue: { cat:'framework', label:'Vue / Nuxt', content:`# Vue / Nuxt
.nuxt/
.output/
dist/
node_modules/
*.local` },

  angular: { cat:'framework', label:'Angular', content:`# Angular
dist/
tmp/
out-tsc/
bazel-out/
.angular/
e2e/*.js
e2e/*.map` },

  django: { cat:'framework', label:'Django', content:`# Django
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
media/
staticfiles/
.env
.env.*
!.env.example` },

  laravel: { cat:'framework', label:'Laravel', content:`# Laravel
/vendor/
/node_modules/
/public/hot
/public/storage
/storage/*.key
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode` },

  // IDEs
  vscode: { cat:'ide', label:'VS Code', content:`# VS Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.history/
*.vsix` },

  jetbrains: { cat:'ide', label:'JetBrains', content:`# JetBrains (IntelliJ, WebStorm, PyCharm, etc.)
.idea/
*.iml
*.iws
*.ipr
out/
.idea_modules/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties` },

  vim: { cat:'ide', label:'Vim / Neovim', content:`# Vim / Neovim
[._]*.s[a-v][a-z]
!*.svg
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
Session.vim
Sessionx.vim
.netrwhist
*~
tags
[._]*.un~` },

  emacs: { cat:'ide', label:'Emacs', content:`# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
.org-id-locations
*_archive
*_flymake.*
/eshell/history
/eshell/lastdir
/elpa/
*.rel
/auto/
.cask/
dist/
flycheck_*.el
/server/
.projectile
.dir-locals.el
/network-security.data` },

  sublimetext: { cat:'ide', label:'Sublime Text', content:`# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
sftp-config.json
sftp-config-alt*.json
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
GitHub.sublime-settings` },

  // OS
  macos: { cat:'os', label:'macOS', content:`# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk` },

  windows: { cat:'os', label:'Windows', content:`# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msix
*.msm
*.msp
*.lnk` },

  linux: { cat:'os', label:'Linux', content:`# Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*` },

  // Tools
  docker: { cat:'tool', label:'Docker', content:`# Docker
*.log
docker-compose.override.yml
.env
.env.*
!.env.example` },

  terraform: { cat:'tool', label:'Terraform', content:`# Terraform
.terraform/
.terraform.lock.hcl
*.tfstate
*.tfstate.*
crash.log
crash.*.log
*.tfvars
*.tfvars.json
override.tf
override.tf.json
*_override.tf
*_override.tf.json
.terraformrc
terraform.rc` },

  gradle: { cat:'tool', label:'Gradle', content:`# Gradle
.gradle/
**/build/
!src/**/build/
gradle-app.setting
!gradle-wrapper.jar
!gradle-wrapper.properties
.gradletasknamecache` },

  maven: { cat:'tool', label:'Maven', content:`# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar` },

  env: { cat:'tool', label:'.env files', content:`# Environment files
.env
.env.*
!.env.example
!.env.sample
!.env.test
*.env` },

  logs: { cat:'tool', label:'Logs & temp', content:`# Logs & Temp
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.tmp
*.temp
.temp/
.tmp/
tmp/
temp/` },
};

const catMap = { lang:'catLang', framework:'catFramework', ide:'catIDE', os:'catOS', tool:'catTool' };
const selected = new Set();

function init() {
  Object.entries(templates).forEach(([key, t]) => {
    const container = document.getElementById(catMap[t.cat]);
    if (!container) return;
    const chip = document.createElement('button');
    chip.className = 'chip';
    chip.textContent = t.label;
    chip.dataset.key = key;
    chip.onclick = () => toggleChip(key, chip);
    container.appendChild(chip);
  });
}

function toggleChip(key, chip) {
  if (selected.has(key)) { selected.delete(key); chip.classList.remove('active'); }
  else { selected.add(key); chip.classList.add('active'); }
  generate();
}

function generate() {
  const output = document.getElementById('outputArea');
  if (selected.size === 0) { output.value = ''; return; }
  const parts = [];
  selected.forEach(key => {
    if (templates[key]) parts.push(templates[key].content);
  });
  output.value = parts.join('\n\n') + '\n';
}

function copyOutput() {
  const val = document.getElementById('outputArea').value;
  if (!val) return;
  navigator.clipboard.writeText(val).catch(() => {});
  const btn = document.getElementById('btnCopy');
  btn.textContent = 'copied!'; btn.classList.add('copied');
  setTimeout(() => { btn.textContent = 'copy'; btn.classList.remove('copied'); }, 2000);
}

function downloadOutput() {
  const val = document.getElementById('outputArea').value;
  if (!val) return;
  const a = document.createElement('a');
  a.href = URL.createObjectURL(new Blob([val], { type: 'text/plain' }));
  a.download = '.gitignore';
  a.click();
  URL.revokeObjectURL(a.href);
}

function clearAll() {
  selected.clear();
  document.querySelectorAll('.chip').forEach(c => c.classList.remove('active'));
  document.getElementById('outputArea').value = '';
}

init();