Skip to content

DevOps

.gitignore Generator

Generate .gitignore files from language, framework, IDE and operating system templates.

Loading tool…

Helpful references

About this tool

What is .gitignore Generator?

Combine ignore rules for the languages, tools and operating systems used by a repository. Review the result against the files you actually intend to version rather than selecting every available template. Ignore rules affect untracked-file discovery; they do not remove files that Git already tracks or undo the disclosure of a committed secret.

A worked example

Exclude installed Node dependencies from new tracking

Example input

Node.js template

Expected result

node_modules/

Select the Node-related template and inspect this rule among the generated entries. It keeps installed dependencies from being added as ordinary untracked content. Preserve package manifests and the appropriate lockfile according to your repository policy. Before committing, inspect Git's actual status so generated outputs or important fixtures are not excluded unintentionally.

Common mistakes and limits

  • Adding a secret filename to .gitignore does not erase an existing commit. Treat an exposed credential as a separate incident requiring the appropriate recovery actions.
  • Negated patterns and ignored parent directories interact. Test an exception rule instead of assuming that a final exclamation-mark pattern always restores a nested file.

Features

What you can do

  • Select multiple .gitignore templates.
  • Search templates by name, category and keyword.
  • Generate rules for Node.js, Next.js, Python, Java, Go and Rust.
  • Add templates for Visual Studio Code and JetBrains IDEs.
  • Add macOS and Windows filesystem rules.
  • Include Docker-related ignore rules.
  • Add custom ignore and negation patterns.
  • Remove duplicate rules automatically.
  • Sort normal and negated rules.
  • Include or remove template comments.
  • Copy or download the generated .gitignore file.
  • Generate every file locally in your browser.

Frequently asked questions

Questions about .gitignore Generator

What does a .gitignore file do?

A .gitignore file tells Git which untracked files and directories should normally be excluded from version control.

Can I combine several templates?

Yes. You can select any number of language, framework, IDE, operating system and tooling templates.

Are duplicate patterns removed?

Yes. Duplicate rules are removed both inside individual templates and across all selected templates.

What does a rule beginning with ! mean?

A leading exclamation mark negates a previous ignore pattern and allows a matching file or directory to be included.

Can I add custom rules?

Yes. Add one custom pattern per line, including negated patterns beginning with an exclamation mark.

Does this tool modify my repository?

No. It only generates text locally and never accesses your Git repository.

Related tools