This generator builds a clean .gitignore file from ready-made templates so you stop copy-pasting from old projects. Pick the languages, operating systems and editors your project uses, and it assembles the right ignore patterns into one tidy, labelled file you can copy or download.
How it works
Each template is a curated block of ignore patterns bundled into the page. When you tick options, the generator concatenates the selected blocks under clear section headers — for example a # Node section followed by a # macOS section. Selecting nothing leaves the output empty; selecting several merges them in order. The result is plain text you can paste into a file named .gitignore at your repo root, where Git applies the patterns to every subdirectory automatically.
Available templates and what they cover
| Template | Key patterns |
|---|---|
| Node | node_modules/, *.log, npm-debug.log* |
| Python | __pycache__/, *.pyc, .Python, venv/, .env |
| Java | *.class, *.jar, target/, .classpath |
| Rust | target/, Cargo.lock (for libraries) |
| Go | vendor build output, binary files |
| macOS | .DS_Store, .AppleDouble, .Spotlight-V100 |
| Windows | Thumbs.db, Desktop.ini, *.lnk |
| Linux | *~, .fuse_hidden*, .nfs* |
| VS Code | .vscode/ (keeps .vscode/extensions.json if needed) |
| JetBrains | .idea/, *.iml, *.iws |
| Env / secrets | .env, .env.local, *.pem, *.key, secrets.json |
| Logs and temp | *.log, *.tmp, *.temp |
| React Native / Expo | .expo/, *.jks, android/build/, ios/Pods/ |
| Terraform | .terraform/, *.tfstate, *.tfvars |
Example
For a typical Node project on a Mac edited in VS Code, tick Node, macOS, VS Code, and Env / secrets. The generator produces:
# Node
node_modules/
# macOS
.DS_Store
# VS Code
.vscode/
# Env / secrets
.env
.env.local
*.pem
*.key
Combining multiple templates
The generator’s main value is mixing templates for projects that span multiple ecosystems. A full-stack project might need Node (for the frontend), Python (for the backend), macOS, VS Code, and Env/secrets all at once. Selecting them all produces one clean merged file with each section labelled and no duplicates.
For a React Native app built on a Mac, tick React Native/Expo, Node, macOS, and Env / secrets together. The result covers native build output, JavaScript dependencies, macOS system files, and credential files in one file.
What to always keep in version control
A .gitignore is about what to exclude. Several files that beginners sometimes add to ignore lists should actually be committed:
- Package lockfiles (
package-lock.json,yarn.lock,Pipfile.lock) — pin exact dependency versions for reproducible installs. - Build configuration (
webpack.config.js,vite.config.ts,tsconfig.json) — shared across all contributors. .env.example— a template with placeholder values showing which environment variables the project needs.- Gradle wrapper, Maven wrapper — pin the build tool version for Java projects.
If a file is already tracked by git, adding it to .gitignore does not stop tracking it. Run git rm --cached <file> to remove it from the index, then commit, and the ignore rule takes effect going forward. All templates are bundled into the page — everything runs in your browser with nothing uploaded.