Pack Camo

.gitignore Generator

Combine templates for your languages, frameworks, editors and OS into one .gitignore.

Everything runs locally with zero file uploads.

.gitignore

106 patterns · 185 lines · 1 duplicate removed

# Generated for: Node, Env & secrets, macOS, Windows, VS Code### Node #### Logslogs*.lognpm-debug.log*yarn-debug.log*yarn-error.log*lerna-debug.log*.pnpm-debug.log*# Diagnostic reports (https://nodejs.org/api/report.html)report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json# Runtime datapids*.pid*.seed*.pid.lock# Coverage directory used by tools like istanbulcoverage*.lcov.nyc_output# Dependency directoriesnode_modules/jspm_packages/bower_components# TypeScript cache*.tsbuildinfo# Optional npm cache directory.npm# Optional eslint / stylelint cache.eslintcache.stylelintcache# Optional REPL history.node_repl_history# Output of 'npm pack'*.tgz# Yarn Integrity file.yarn-integrity# dotenv environment variable files.env.env.development.local.env.test.local.env.production.local.env.local# parcel-bundler cache.cache.parcel-cache# Build outputdistbuild# Gatsby files.cache/public# Serverless directories.serverless/# FuseBox cache.fusebox/# DynamoDB Local files.dynamodb/# TernJS port file.tern-port# Stores VSCode versions used for testing VSCode extensions.vscode-test# yarn v2.yarn/cache.yarn/unplugged.yarn/build-state.yml.yarn/install-state.gz.pnp.*### Env & secrets #### Environment files.env.*!.env.example!.env.sample!.env.template# Keys and certificates*.pem*.key*.p12*.pfx*.crt*.cerid_rsaid_rsa.pubid_ed25519id_ed25519.pub# Credentialscredentials.jsonsecrets.jsonsecrets.yml*.secret.npmrc.pypirc.netrcservice-account*.json### macOS #### General.DS_Store.AppleDouble.LSOverrideIcon[\r]# Thumbnails._*# Files that might appear in the root of a volume.DocumentRevisions-V100.fseventsd.Spotlight-V100.TemporaryItems.Trashes.VolumeIcon.icns.com.apple.timemachine.donotpresent# Directories potentially created on remote AFP share.AppleDB.AppleDesktopNetwork Trash FolderTemporary Items.apdisk### Windows #### Windows thumbnail cache filesThumbs.dbThumbs.db:encryptableehthumbs.dbehthumbs_vista.db# Dump file*.stackdump# Folder config file[Dd]esktop.ini# Recycle Bin used on file shares$RECYCLE.BIN/# Windows Installer files*.cab*.msi*.msix*.msm*.msp# Windows shortcuts*.lnk### VS Code ###.vscode/*!.vscode/settings.json!.vscode/tasks.json!.vscode/launch.json!.vscode/extensions.json!.vscode/*.code-snippets# Local History for Visual Studio Code.history/# Built Visual Studio Code Extensions*.vsix

Already-tracked files stay tracked: run git rm --cached <file> to stop tracking them.

One .gitignore for your whole stack

This .gitignore generator combines ready-made templates for languages, frameworks, build tools, editors and operating systems into a single file. Pick Node and Next.js, add macOS, Windows and VS Code, and you get one .gitignore with a clearly labelled section for each, every pattern listed only once, and room for your own lines. The templates are condensed from GitHub's widely used github/gitignore collection, and everything is assembled in your browser.

How to generate a .gitignore

  1. 1Type a language, framework, editor or OS in the search box — python, unity, jetbrains — and click a chip to add it. Enter adds the first match.
  2. 2Combine as many templates as your project needs. A typical web project uses a language, a framework, your editor and your operating system.
  3. 3Add project-specific paths in Custom lines, such as /uploads/ or *.sqlite.
  4. 4Copy the result or Download it as .gitignore and place it in the root of your repository.

What a .gitignore file does

A .gitignore lists files Git should not track: dependencies that a package manager can restore (node_modules/, vendor/), build output (dist/, target/), caches, logs, editor settings and secrets such as .env. Keeping them out makes repositories smaller, diffs readable and accidental leaks of credentials less likely.

The file only affects untracked files. If something is already committed, adding it to .gitignore does not remove it; run git rm --cached <file> (or git rm -r --cached <dir>) and commit to stop tracking it while keeping the local copy.

.gitignore pattern syntax

Order matters: the last matching pattern wins, which is why negations such as !.vscode/settings.json come after the broad .vscode/* they carve an exception from.

*.log
A pattern without a slash matches at any depth: every .log file in the repository.
/build
A leading slash anchors the pattern to the directory containing the .gitignore, so only the top-level build is ignored.
dist/
A trailing slash matches directories only, not a file named dist.
**/temp
Two asterisks match any number of directories: temp in the root or anywhere below it.
!.env.example
A leading exclamation mark re-includes a file excluded by an earlier pattern. It cannot re-include a file whose parent directory is excluded.
# comment
Lines starting with # are comments; blank lines are separators. Put a backslash before a leading # or ! to match it literally.

How templates are combined

Each template becomes a section headed ### Name ###. With Remove duplicate patterns on, a pattern that already appeared in an earlier section is left out of later ones, and a comment block whose patterns were all removed goes with them, so the file stays short without losing its explanations. Negated patterns are kept in place, because their position relative to the pattern they override is what gives them meaning.

Templates for build tools and frameworks often overlap — Node, Next.js and Vite all ignore node_modules and logs — so de-duplicating a combined file typically removes a fifth or more of its lines.

Project, global and local ignore files

Commit the project .gitignore so everyone shares it, and keep it to files the project itself produces. Files only your machine creates — .DS_Store, Thumbs.db, your editor's folder — can also go in a global ignore file, set with git config --global core.excludesFile ~/.gitignore_global, so you never have to add them to each repository. For ignores that are yours alone in one repository, use .git/info/exclude, which is never committed.

Lock files such as package-lock.json, poetry.lock and Cargo.lock for applications should be committed, not ignored: they make installs reproducible. None of the templates here ignores them. To check which rule ignores a file, run git check-ignore -v path/to/file.

Keep secrets out of Git

The Env & secrets template ignores .env files, private keys and common credential files while keeping .env.example, the file that documents which variables a project needs. Ignoring a secret only prevents future commits: if a key has ever been pushed, rotate it, because it remains in the history. Related tools: chmod calculator for file permissions and robots.txt generator for what crawlers may fetch.

Frequently asked questions

Where do I put the .gitignore file?
In the root of your repository, next to the .git folder. You can also add .gitignore files in subdirectories; their patterns apply relative to that directory.
Why is a file still tracked after I added it to .gitignore?
.gitignore only affects untracked files. Run git rm --cached <file> (or git rm -r --cached <folder>) and commit, and Git stops tracking it while leaving your local copy in place.
Should I ignore package-lock.json or yarn.lock?
No, for applications. Lock files pin exact dependency versions so every install is identical, and should be committed. Only ignore the lock files of a package manager your project does not use.
Should .vscode or .idea be in .gitignore?
Usually the personal parts. The VS Code template ignores .vscode/* but keeps shared settings.json, tasks.json, launch.json and extensions.json; the JetBrains template ignores the whole .idea folder.
How do I ignore .DS_Store on every project?
Add it to a global ignore file: create ~/.gitignore_global containing .DS_Store and run git config --global core.excludesFile ~/.gitignore_global.
How do I ignore everything in a folder except one file?
Ignore the folder's contents, not the folder, then negate the file: folder/* followed by !folder/keep.txt. A pattern like folder/ excludes the directory itself, and nothing inside it can be re-included.
Where do these templates come from?
They are condensed from GitHub's github/gitignore repository, released under CC0, with obsolete entries trimmed. Review the output for your project; every repository has a few paths of its own.