User Rating 0.0
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

About

A misconfigured .gitignore file risks committing sensitive credentials, bloated binary artifacts, or OS-specific metadata into version control. Once committed, removing tracked files from history requires destructive operations like git filter-branch or BFG Repo-Cleaner. This tool generates standards-compliant ignore patterns aggregated from GitHub's official template repository and community best practices. It handles glob syntax including negation patterns (!), directory markers (/), and recursive wildcards (**).

The generator merges multiple templates with automatic deduplication. Patterns are grouped by category with inline documentation. The output conforms to the gitignore format specification defined in git-scm.com/docs/gitignore. Note: this tool produces patterns for common project structures. Custom build output directories or proprietary tooling may require manual additions.

gitignore git version control developer tools code generator ignore file repository setup

Formulas

The .gitignore file uses glob pattern matching defined by fnmatch(3) with additional Git-specific extensions. The pattern resolution follows a precedence chain:

Pfinal = Plocal Pglobal Prepo

Where Plocal is the .gitignore in the current directory, Pglobal is from core.excludesFile, and Prepo is .git/info/exclude. A negation pattern !pattern re-includes a previously excluded file. A trailing slash (/) matches directories only. A leading slash anchors to the repository root. The wildcard ** matches across directory boundaries.

The deduplication algorithm this generator uses operates as:

Output = unique(T1 T2 Tn)

Where each Ti is a selected template's pattern set. Duplicate patterns are removed while preserving the categorical comment structure for readability.

Reference Data

TemplateCategoryKey PatternsCommon Use Case
Node.jsRuntimenode_modules/, .npm, dist/JavaScript/TypeScript projects
PythonLanguage__pycache__/, *.pyc, .venv/Django, Flask, ML projects
JavaLanguage*.class, target/, *.jarMaven/Gradle builds
GoLanguagebin/, *.exe, vendor/Go modules projects
RustLanguagetarget/, Cargo.lock (lib)Cargo-based projects
C/C++Language*.o, *.so, build/CMake, Make projects
RubyLanguage*.gem, .bundle/, vendor/bundleRails, gem development
PHPLanguagevendor/, composer.lockLaravel, Symfony apps
SwiftLanguage.build/, *.xcodeprojiOS/macOS development
Dart/FlutterFramework.dart_tool/, build/Flutter mobile apps
React/Next.jsFramework.next/, out/, node_modules/React SPAs and SSR apps
UnityEngineLibrary/, Temp/, *.cgincGame development
Unreal EngineEngineBinaries/, Intermediate/AAA game projects
VS CodeIDE.vscode/, *.code-workspaceEditor-specific settings
JetBrainsIDE.idea/, *.imlIntelliJ, WebStorm, PyCharm
Visual StudioIDE.vs/, *.suo, *.user.NET development
VimEditor*.swp, *~, .netrwhistTerminal editor artifacts
macOSOS.DS_Store, .AppleDoubleMac filesystem metadata
WindowsOSThumbs.db, desktop.iniWindows Explorer artifacts
LinuxOS*~, .nfs*Linux temp/lock files
TerraformDevOps.terraform/, *.tfstateInfrastructure as Code
DockerDevOps.dockerignore patterns overlapContainer builds
Environment FilesSecurity.env, .env.local, *.pemSecret management
LaTeXDocument*.aux, *.log, *.tocAcademic papers
GradleBuild.gradle/, build/Android/Java builds

Frequently Asked Questions

Git processes .gitignore patterns top-to-bottom. The last matching pattern wins. This generator groups patterns by category, so if Template A ignores *.log and Template B includes a negation !important.log, the negation must appear after the ignore rule. The generator preserves this ordering within each category block. For conflicting rules across categories, review the output and adjust manually.
For applications (binaries, deployed services): commit lock files. They ensure reproducible builds. For libraries (npm packages, crates): the convention differs. npm recommends committing package-lock.json for libraries, while Rust recommends ignoring Cargo.lock for library crates. This generator includes Cargo.lock in the Rust library template but not in the binary template.
Adding a pattern to .gitignore does not untrack files already in the index. Run git rm --cached <file> to remove it from tracking while keeping the local copy. For directories: git rm -r --cached <dir>/. Then commit the removal. The .gitignore pattern will prevent future re-addition.
The .gitignore file is committed to the repository and shared with all collaborators. The .git/info/exclude file is local-only and never shared. Use exclude for personal IDE configs or local test files that only apply to your machine. A third option, core.excludesFile, sets a global ignore file (typically ~/.gitignore_global) applied to all repositories on your system.
Yes. A single * matches anything except a slash (/), so *.log matches debug.log but not logs/debug.log. A double ** matches across directory boundaries: **/debug.log matches debug.log in any subdirectory. The pattern a/**/b matches a/b, a/x/b, and a/x/y/b.
Use a negation pattern. First ignore everything with *, then re-include specific files: !.gitignore, !src/, !src/**. Note: you cannot negate a file inside an ignored directory without first un-ignoring the parent directory. The custom patterns input in this generator supports negation syntax.