.gitignore Generator

Pick your stacks — languages, platforms, operating systems and editors — and get one combined, deduplicated .gitignore. Nothing leaves your browser.

Updated:

100% client-side

Select stacks

Languages & runtimes

Platforms & frameworks

Operating systems

Editors & IDEs

0 of 18 stacks selected

.gitignore preview


        
—

How the .gitignore Generator works

Every template behind this tool is copied verbatim from GitHub's own github/gitignore repository — the same CC0-licensed presets GitHub offers when you create a new repository. Pick one or more stacks and the tool concatenates their templates, comparing every non-comment line exactly (ignoring only trailing whitespace) so a pattern shared by two stacks — like .DS_Store or *.log — appears just once. Comments and blank lines are never deduplicated, so each stack's own section still reads the way GitHub wrote it.

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# Metadata left by Dolphin file manager, which comes with KDE Plasma
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# Log files created by default by the nohup command
nohup.out

### Vim ###
# Swap
[._]*.s[a-v][a-z]
# comment out the next line if you don't need vector files
!*.svg
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

Notice *~ — Linux's own backup-file pattern — appears once even though Vim's template lists it too: it was already added under the Linux section, so Vim's copy is dropped while everything else Vim contributes stays intact. The result is ready to copy or download as-is; there's no lock-in, it's a normal .gitignore file you can keep editing by hand afterward.

Examples

1. A Go project edited in VS Code. Selecting Go and Visual Studio Code gives a 46-line file (807 characters). The VS Code part, at the end of the file, ignores the editor folder but keeps the settings worth sharing:

### 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

The ! lines re-include files that .vscode/* would otherwise ignore, so shared settings.json and launch.json end up in the repo. The Go template also ignores .env; to move those values between .env and JSON, use the .env ↔ JSON Converter.

2. Terraform on a Mac. Terraform + macOS gives 104 lines (2138 characters). The lines that matter most keep state and variable files out of the repo, since they can contain secrets:

### Terraform ###
# Local .terraform directories
.terraform/

# .tfstate files
*.tfstate
*.tfstate.*
…
*.tfvars
*.tfvars.json
…
### macOS ###

A .gitignore only affects untracked files. If a .tfvars or .env file was committed before, remove it from the index with git rm --cached and rotate any secrets it contained; the Password Strength Checker helps you judge the new ones. The matching rules (*, !, trailing /) are documented in git's gitignore reference.

Frequently asked questions

Where do these .gitignore templates come from?

Every template embedded in this tool is copied from GitHub's own github/gitignore repository (CC0-licensed, the same templates GitHub offers when you create a new repo), so the patterns match what a fresh GitHub-created .gitignore would contain.

How does it handle duplicate lines when I pick several stacks?

Lines are compared exactly, ignoring trailing whitespace. If two selected stacks contain the exact same ignore pattern, it's kept only once, under the first stack that contributes it. Comments and blank lines are never deduplicated, so every stack's section stays readable on its own.

Is this the same as gitignore.io?

It works similarly — pick stacks, get a merged file — but every template is embedded in this page and the merge runs entirely in your browser; no request is ever sent to a server.

Can I edit the generated file afterward?

Yes. Copy or download it, then edit freely — it's a normal .gitignore file with no lock-in to this tool.