Skip to content

Gitignore Generator

Generate custom .gitignore files for your projects. Select from popular templates for languages, frameworks, IDEs, and operating systems. Combine multiple templates and add custom rules with ease.

Category: code
Use Case: New Projects, Multi-Stack Apps, Team Standards
Privacy: 100% browser-based

Quick Presets

Select Templates

Languages

Frameworks

IDEs

Operating Systems

Other

Add any custom patterns not covered by the templates above

Preview

0 templates2 lines

# Created with Gitignore Generator
# https://claude.com/claude-code

Recommended Settings

Gitignore Best Practices

  • Commit .gitignore before adding other files to ensure rules apply immediately
  • Use specific patterns (e.g., /build/) instead of global ones (build/) when possible
  • Add comments to document why specific patterns are ignored
  • Review and update .gitignore as your project evolves
  • Keep OS-specific and IDE-specific patterns at the top for clarity

Common Patterns

  • Use * for any characters (e.g., *.log matches all .log files)
  • Use / at the end to match directories only (e.g., node_modules/)
  • Use ! to negate patterns and include specific files
  • Leading / matches files only in the root directory
  • Use ** to match nested directories at any depth

Pro Tips

  • Combine templates to cover all aspects of your tech stack
  • Add .env files to prevent accidental credential commits
  • Include build and dist folders to keep repository clean
  • Add IDE-specific files even if you use version control for settings

Most Popular

Node.js + VSCode + macOS + Environment variables + Logs

How It Works

1

Select a quick preset or choose individual templates by category

2

Search for specific templates using the search bar

3

Combine multiple templates by checking the boxes

4

Add custom patterns in the custom patterns field

5

Toggle comments on/off based on your preference

6

Preview the generated .gitignore in real-time

7

Copy to clipboard or download as .gitignore file

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Pure JavaScript for optimal performance on modern browsers.

Secure

No data collection, no tracking, no sign-up required.

Frequently Asked Questions

Can I combine multiple templates?

Yes! Simply check multiple template boxes. The generator will combine all selected templates into a single .gitignore file, organized by category with proper spacing.

What if I need a pattern not in the templates?

Use the "Custom Patterns" field to add any patterns specific to your project. Add one pattern per line, just like you would in a regular .gitignore file.

What do the different pattern symbols mean?

* matches any characters, / at the end matches directories only, ! negates patterns to include files, leading / matches root only, and ** matches nested directories at any depth.

Should I commit the .gitignore file?

Yes! The .gitignore file itself should be committed to your repository so all team members use the same ignore rules. It's typically one of the first files you commit.

Will this remove files already tracked by Git?

No. Adding patterns to .gitignore only affects untracked files. To stop tracking files already in Git, you need to run 'git rm --cached <file>' first.