.gitignore Generator

Combine .gitignore templates for languages, IDEs and OSes.

The .gitignore Generator builds a ready-to-save .gitignore file by combining templates for the languages, editors, operating systems and tools you use. Pick one or more templates, add your own patterns, and copy or download the merged result. It saves you from hunting for the right patterns and from committing build output, dependencies and secrets by accident.

What is a .gitignore file?

A .gitignore file is a plain text file that tells Git which files and folders it should not track. Each line is a pattern: node_modules/ ignores a directory, *.log ignores every file ending in .log, and a leading ! re-includes something an earlier pattern excluded. Lines starting with # are comments. Patterns are matched relative to the folder that holds the .gitignore, and a trailing slash restricts a pattern to directories. Ignoring files only affects untracked files: if a file is already committed, adding it to .gitignore does not remove it from the repository, you must also untrack it with git rm --cached. Typical entries are dependency folders, compiled output, editor settings, operating-system files such as .DS_Store, and local environment files that hold secrets.

How to use .gitignore Generator

  1. Find your templates Type in Search templates to narrow the list, or scroll through the template buttons.
  2. Select what you need Click each template button to toggle it. Selected buttons are highlighted and the line under the list shows how many are selected and their names.
  3. Add custom patterns Optionally type your own patterns in Custom patterns (optional), one per line.
  4. Copy or download The merged file appears in the .gitignore box. Copy it or download it as .gitignore and place it in the root of your repository.

Frequently asked questions

Which templates are included?

There are 25: Node, Python, Java, Go, Rust, .NET, PHP, Ruby, Swift, Unity, Visual Studio, JetBrains, VS Code, macOS, Windows, Linux, Terraform, Docker, C++, Kotlin / Android, Dart / Flutter, Elixir, Jupyter, Vim and Logs.

Where do I put the .gitignore file?

Usually in the root of the repository. Git also reads .gitignore files in subfolders, and those rules apply only to that folder and below.

What does a leading ! mean?

It negates a pattern, re-including a file that an earlier rule ignored. For example the Java template keeps gradle/wrapper/gradle-wrapper.jar even though *.jar is ignored. Git cannot re-include a file if one of its parent directories is excluded.

Why does the merged file leave out some patterns from later templates?

Identical pattern lines are only written once. The first template that contains a pattern keeps it, and later sections skip it. Negation lines starting with ! and blank lines are always kept.

Can I ignore files only on my machine?

Yes. Put personal rules in .git/info/exclude for one repository, or set a global ignore file with git config --global core.excludesFile. Use .gitignore for rules the whole team should share.

Is what I type sent anywhere?

No. The templates are built into the page and the merge happens locally, so your custom patterns stay in the page.