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.
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.
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.
Usually in the root of the repository. Git also reads .gitignore files in subfolders, and those rules apply only to that folder and below.
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.
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.
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.
No. The templates are built into the page and the merge happens locally, so your custom patterns stay in the page.