Gitignore - Node Monorepo With Re-Included Artefacts
A realistic monorepo ignore file that uses `dist/*` rather than `dist/` precisely so the two `!dist/...` re-inclusions below it can work. It also carries the `.env.*` / `!.env.example` and `*.log` / `!logs/retained/*.log` pairs that every ignore-matcher has to order correctly.
# Dependencies
node_modules/
.pnpm-store/
# Build output — the whole tree is ignored, then two artefacts are re-included
dist/*
!dist/manifest.json
!dist/.keep
# Per-workspace output
packages/*/lib/
packages/*/.turbo/
# Environment
.env
.env.*
!.env.example
# Editors and OS
.DS_Store
.idea/
*.swp
# Logs
*.log
!logs/retained/*.log
Specifications
- Seed
- 20260807
- Repository Name
- .gitignore
- Patterns
- 18
- Negations
- 4
- Uses Trailing Slash
- true
- Uses Star Before Negation
- true
- Line Endings
- LF
- Encoding
- UTF-8
Testing contract
Expected to pass- Scenario
- Ask an ignore-matcher whether dist/manifest.json, dist/bundle.js, .env.example and logs/retained/audit.log are ignored.
- Expected result
- dist/manifest.json is NOT ignored, dist/bundle.js IS ignored, .env.example is NOT ignored, logs/retained/audit.log is NOT ignored — last matching pattern wins.
What is a .gitignore file?
A .gitignore file tells Git which untracked paths to leave alone. Each line is a pattern: a leading `/` anchors it to the containing directory, a trailing `/` restricts it to directories, `!` re-includes a previously excluded path, `**` matches across directory boundaries, and `#` introduces a comment. Rules are evaluated in order, with the last matching pattern winning, and nested .gitignore files layer on top of parent ones.
How to use this file
Use an example .gitignore file to test ignore-pattern engines in build tools, bundlers, linters, and container builders, checking negation ordering, anchored versus floating patterns, and directory-only rules against a documented set of expected matches.
How to use this file for testing
“Gitignore - Node Monorepo With Re-Included Artefacts” is a deterministic Novus Examples fixture for Config parsing, Config testing, Visual diff / regression. TOML and INI configuration files with nested sections and typed values — for testing config parsers and loaders.
Documented properties for this file: seed 20260807 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Diff and patch fixtures name their target paths and the exact edge case they exercise — rename, mode change, binary hunk, CRLF↔LF, or missing trailing newline. Apply or render them against the documented before-state; every author, path, and hash is fictional.
Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.
Related files
- txtCODEOWNERS - Overlapping Globs With Documented WinnersDeliberately overlapping rules so every interesting path matches two or three of them, which is the only way to test that a resolver applies last-match-wins rather than most-specific-wins. One rule has no owners at all, which clears inherited ownership instead of adding any.

- gitattributesGitattributes - LFS Filters, Linguist Hints and export-ignoreThe non-EOL half of the format: LFS filter/diff/merge triples, `linguist-generated` and `linguist-vendored` hints that hide files from language statistics and review, `export-ignore` entries that drop paths from `git archive`, and a `merge=union` driver for an append-only changelog. Attribute values are unquoted and space-separated, so column alignment is whitespace a parser must collapse.

- gitconfigGitconfig - includeIf Conditions in Four FlavoursEvery conditional-include form git supports — path prefix, case-insensitive path prefix, branch glob, and a condition on an existing remote URL — plus one unconditional include. Order matters: a later include overrides an earlier one, so a parser that gathers includes into a set rather than a list resolves the wrong identity.

- gitconfigGitconfig - Sections, Quoted Subsections and Shell AliasesA realistic global config exercising the whole INI-like grammar: bracketed sections, quoted subsection names that are case-sensitive while section names are not, values with size suffixes, a shell alias whose leading `!` changes how the rest is executed, and both comment characters.

- gitignoreGitignore - Escaped #, !, Bracket and Trailing SpaceEvery escape the format defines, including the one nobody expects: a trailing space is stripped from a pattern unless it is backslash-escaped, so `draft\ ` and `draft` ignore different files. Editors that trim trailing whitespace on save silently change what this file means.

- gitignoreGitignore - Globstar, Anchors and Character ClassesOne pattern per rule in the gitignore grammar: a leading slash that anchors to the containing directory, the same name unanchored, `**` in all three positions, `?` and `[...]` classes, and a trailing slash that matches only directories. Every line is a separate assertion for a matcher's test suite.

Generated by generation/version_control.py. Free for any use, no attribution required — license.