Gitattributes Generator
Build a .gitattributes file without memorizing the syntax. Toggle line-ending normalization, list the extensions Git LFS should track, and add vendored or export-ignore paths. The file rebuilds as you type, then copy it or download it as .gitattributes for your repo root.
How to generate a .gitattributes
- Leave 'Normalize line endings (* text=auto)' checked to let Git manage CRLF and LF, or uncheck it to omit that line.
- In 'Git LFS extensions', list the file types to store in Git LFS, one per line or comma separated (a leading dot is optional).
- In 'Linguist vendored paths', add globs or folders GitHub should exclude from language stats.
- In 'Export-ignore paths', add anything to leave out of git archive tarballs, such as tests/ and .github/.
- Review the generated .gitattributes preview, then click Copy or Download to save it in the root of your repository.
Examples
Full file from the default inputs
normalize on; LFS: psd, zip, mov; vendored: vendor/**; export: tests/, .github/
* text=auto *.psd filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.mov filter=lfs diff=lfs merge=lfs -text vendor/** linguist-vendored tests/ export-ignore .github/ export-ignore
LFS only, leading dot optional
normalize off; LFS: psd, .zip
*.psd filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text
Vendored and export-ignore paths
vendored: vendor/**, third_party/; export: tests/
vendor/** linguist-vendored third_party/ linguist-vendored tests/ export-ignore
Frequently asked questions
What does * text=auto do?
It lets Git decide which files are text and normalize their line endings to LF in the repository, while checking them out with your platform's native endings. It is the single most common .gitattributes line for cross-platform teams.
What exactly does the Git LFS section write?
For each extension it emits one line of the form '*.ext filter=lfs diff=lfs merge=lfs -text', for example '*.psd filter=lfs diff=lfs merge=lfs -text'. That is the same attribute set 'git lfs track' would add for that pattern.
Does generating the file install Git LFS for me?
No. This tool only writes the text. You still need Git LFS installed (run 'git lfs install' once), then commit the .gitattributes so teammates pick up the same tracking rules.
Do I type extensions with or without a dot?
Either works. 'psd' and '.psd' both become '*.psd'. Entries that already contain a '*' or a '/' are treated as globs or paths and passed through unchanged, so 'vendor/**' stays as written.
Can I separate entries by commas or new lines?
Both. Each of the three text boxes splits on commas and new lines, so a list like 'psd, zip' and a stacked list on separate lines produce the same result. Blank entries are ignored.
What is linguist-vendored for?
It marks paths as vendored so GitHub's Linguist leaves them out of your repository's language breakdown. It is useful for bundled third-party libraries that would otherwise skew the stats.
When should I use export-ignore?
Paths marked export-ignore are excluded from archives made with 'git archive', such as release tarballs. Common picks are tests/, CI config like .github/ and other files that do not need to ship.
Are duplicates and ordering handled?
Identical entries in a box are dropped while original order is kept. Sections always appear in a fixed order (text=auto, then LFS, vendored, export-ignore), each separated by a blank line, and the file ends with a trailing newline.
Is my configuration private?
Yes. The file is built entirely in your browser as you type and nothing is uploaded to any server.
Learn more
- How .gitattributes controls text, LFS and Linguist
What a .gitattributes file does, how text=auto normalizes line endings, and how filter=lfs and linguist rules change a repo's behavior.
Related tools
Gitignore Generator
Build a .gitignore from Node, Python, Java, Go, Rust, macOS, Windows and more. Pick your stacks, copy or download the file. Runs in your browser.
EditorConfig Generator
Generate a .editorconfig file online. Set indent style, size, line endings, charset and per-file overrides, then copy the result. Free and private.
Dockerignore Generator
Generate a .dockerignore file online. Combine Node, Python, Go and Java presets with custom patterns, deduplicated, then copy it. Free and private.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.