Skip to content
Novus Examples
gitattributes642 B

Gitattributes - LFS Filters, Linguist Hints and export-ignore

The 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.

Preview — first 19 linesgitattributes
# Git LFS — the four-part filter every LFS pointer needs
*.psd     filter=lfs diff=lfs merge=lfs -text
*.mp4     filter=lfs diff=lfs merge=lfs -text

# Keep generated code out of the language statistics and out of review diffs
web/src/api/generated/**  linguist-generated=true
docs/vendor/**            linguist-vendored=true
*.min.js                  linguist-generated=true -diff

# Force a language for an ambiguous extension
*.h       linguist-language=C

# Excluded from git archive exports
/.github/     export-ignore
/e2e/         export-ignore

# Union merge for an append-only file, so both sides survive
CHANGELOG.md  merge=union

Specifications

Seed
20260807
Repository Name
.gitattributes
Rules
10
Lfs Patterns
2
Linguist Hints
4
Export Ignores
2
Merge Drivers
1
Line Endings
LF
Encoding
UTF-8

Testing contract

Expected to pass
Scenario
Resolve the full attribute set for web/src/api/generated/client.ts and for CHANGELOG.md.
Expected result
The generated client is marked linguist-generated=true; CHANGELOG.md resolves to merge=union, so a merge concatenates both sides instead of conflicting.

What is a .gitattributes file?

A .gitattributes file assigns per-path attributes that change how Git handles matching files. It controls end-of-line normalisation (`text`, `-text`, `eol=lf`), diff and merge drivers, export filtering, `linguist-*` language hints, and Git LFS filters, using the same pattern syntax as .gitignore with attributes listed after each pattern.

How to use this file

Use an example .gitattributes file to test attribute parsers and repository-tooling that has to honour line-ending or diff-driver rules, verifying that binary paths are excluded from text normalisation and that later patterns override earlier ones.

How to use this file for testing

“Gitattributes - LFS Filters, Linguist Hints and export-ignore” 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.

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