{{ summaryTitle }}
{{ summaryValue }}

{{ summaryLine }}

{{ badge.label }} {{ badge.value }}

{{ summaryAnnouncement }}

Repository ignore-rule inputs
Start with the repository shape that best matches what the team ships.
The primary stack anchors the generated file; add polyglot packs in Advanced.
Cross-platform is the safest default for teams using mixed desktops.
Keep sample files trackable while excluding local values that may contain secrets.
{{ stackPackSelection.length ? `${stackPackSelection.length} extra pack(s) selected.` : 'None selected; the primary stack is sufficient for a single-stack repository.' }}
The default keeps common VS Code team recommendations available to commit.
The neutral default adds no strategy beyond exceptions already included by selected packs.
Use forward slashes and test broad rules with git check-ignore.
Exceptions work only when parent directories remain visible to Git.
Comments improve reviewability without changing ignore matching.
{{ params.include_comments ? 'Included' : 'Omitted' }}
{{ values.gitignore_text }}
{{ textExportAnnouncement }}
{{ chartExportAnnouncement }}

The chart renderer is unavailable. Exact counts remain available in the pattern ledger.

SourceSectionRulesExamplesWhy / reviewCopy
{{ row.source }}{{ row.section }}{{ row.rule_count }}{{ row.examples }}{{ row.reason }}
{{ tableExportAnnouncement }}

A clean Git status should separate work worth reviewing from files that can be rebuilt, recreated, or kept on one workstation. A repository-level .gitignore records that boundary for everyone who clones the project. It commonly covers dependency folders, build output, caches, logs, local environment files, and editor state.

Ignore rules affect intentionally untracked paths. They do not delete files, remove committed content from history, or protect secrets that were already added to Git. If a matching file is tracked, it stays tracked until it is deliberately removed from the index. That distinction matters most for environment files and credentials, where adding an ignore rule after a leak is not remediation.

Where different Git ignore rules belong
Rule scope Best home Typical example
Shared project rule A committed .gitignore Build folders, test output, and local environment files used by the project.
Repository-specific personal rule .git/info/exclude A local scratch directory that teammates should not inherit.
Personal rule for every repository The file configured by core.excludesFile Backup files or editor artifacts created on one workstation.

Patterns are relative to the directory containing the ignore file. A trailing slash limits a pattern to directories, a leading slash anchors it to that ignore file's directory, and ** can span directory levels. When several patterns apply at the same precedence level, the last matching pattern decides the result.

An exception begins with ! and makes a previously ignored path eligible again. It cannot recover a file from a parent directory that Git has already excluded, because Git does not descend into ignored directories to search for later exceptions. Broad allow-list designs therefore need explicit rules that reopen each parent directory before they reopen a file below it.

A useful ignore file is narrower than a list copied from every technology the team has ever tried. Extra stack patterns can hide source, fixtures, documentation, or lock files that should be reviewed. Match the rules to the repository that exists, keep shared policy separate from personal noise, and test surprising matches before committing the file.

How to Use This Tool:

Start with the repository's main purpose and primary stack, then add only the workstation, secret, and exception rules that belong in shared version control.

  1. Choose Project profile and Primary stack to establish the main groups of generated paths. Add Additional stack packs only for languages or frameworks that are actually present in the repository.
  2. Set Workstation coverage, Editor and IDE, and Environment and secrets. Prefer personal excludes over project rules when an artifact belongs to only one developer.
  3. Select Generated exceptions when sample configuration, editor recommendations, placeholder files, or allow-list seed paths must remain trackable.
  4. Enter one rule per line under Custom ignore patterns. Put paths that must be re-included under Custom keep exceptions; a missing leading ! is added automatically.
  5. Read the summary before copying the file. A Review .gitignore draft status means broad patterns, duplicates, trimmed lines, backslashes, exceptions, or policy combinations need attention.
  6. Inspect Pattern ledger to see which rule group contributed each pattern. Test uncertain paths with git check-ignore -v <path>, then commit the generated file only when ordinary source and required samples remain visible.

Interpreting Results:

The rule count measures unique generated patterns, not quality. A larger file may be justified for a real polyglot monorepo, while the same file would be risky in a small single-stack application. Use the section count and ledger to confirm that every group has a current owner and purpose.

  • Ready .gitignore draft means no built-in review warning was raised. It does not prove that every pattern is appropriate for the repository.
  • Review .gitignore draft means the generated file is available, but at least one warning should be resolved or consciously accepted.
  • A duplicate count means the first occurrence was retained and later identical patterns were removed. It does not mean two broader patterns have equivalent matching behavior.
  • After adding the file, compare git status --short with git status --ignored --short. If an expected source file disappears, use git check-ignore -v to identify the exact rule.

Technical Details:

Git combines exclusion patterns from several sources. Command-line patterns have the highest precedence, followed by per-directory .gitignore files, repository-local excludes, and the user's global excludes. Within one precedence level, later matching patterns override earlier ones.

A pattern without a slash can match a name at any depth below the ignore file. A slash at the start or in the middle makes the match relative to that file's directory, and a trailing slash restricts the match to directories. Wildcards do not behave exactly like regular expressions: * does not cross a slash, while specific ** placements can cross directory levels.

Rule Core:

Core Git ignore pattern rules
Pattern form Meaning Important boundary
cache/ Matches directories named cache below the ignore file. It does not match a regular file named cache.
/build/ Matches the build directory at the ignore file's level. It does not match a nested src/build/ directory.
*.log Matches names ending in .log throughout the applicable tree. A tracked log remains tracked.
!config.example Re-includes a matching path after an earlier ignore rule. The parent directory must still be visible to Git.
a/**/b Matches b below a with zero or more intervening directories. Other repeated-asterisk placements may not have this recursive meaning.

Transformation Core:

The generated file is assembled in a fixed order so the result remains reviewable. Rule groups come from the project profile, primary and additional stacks, workstation pack, editor pack, environment policy, generated keep strategy, custom patterns, and custom keep exceptions.

  1. Resolve every selected pack and append its labeled rule sections.
  2. Trim custom lines, preserve custom comment lines, and flag broad patterns, backslashes, or attempts to ignore .git.
  3. Convert each custom keep entry to a negated pattern by adding ! when necessary.
  4. Walk patterns from first to last, keep the first exact occurrence, and omit later duplicates.
  5. Render section headings and reminders only when Section comments is enabled; comment removal does not change the pattern set.

Exact-string deduplication does not prove semantic equivalence. For example, build/ and **/build/ are different patterns even when both happen to match the current tree. The ledger exposes both so repository-specific testing can decide whether either rule is too broad.

The built-in warnings are review prompts. They flag a deliberately small set of hazards, including all-tree patterns such as * or /**, excessive stack packs, missing secret handling for profiles that commonly need it, and allow-list exceptions without a deliberate broad rule. Git itself remains the authority on the final match.

Worked Examples:

Keep an environment template

Choose Ignore env files, keep samples for an application that stores local values in .env and publishes .env.example. The draft places .env and .env.* before !.env.example, so the real values stay ignored while the sample remains eligible for tracking. Confirm the sample contains placeholders rather than credentials before committing it.

Reopen a file below an ignored directory

If a custom rule ignores reports/, adding only !reports/summary.md will not recover the summary because the parent directory is excluded. Replace the broad directory rule with a form that keeps the directory visible, then add the narrow exception and verify the path with git check-ignore -v reports/summary.md.

References: