.gitattributes Generator
Build a .gitattributes file from toggles: normalize line endings, force LF or CRLF for named extensions, mark binary types, track files with Git LFS, and exclude paths from language stats and archives.
Presets
A preset replaces the sections below with sensible defaults for that project type.
Line endings
Mark as binary
Marking a file type binary stops it being shown as a text diff or merged line by line.
Track with Git LFS
One file pattern per line.
Exclude from stats and archives
Marked linguist-vendored, left out of the language breakdown.
Marked linguist-generated, also left out of the language breakdown.
Left out of archives created with git archive, such as a release zip.
Everything runs in your browser. Nothing is uploaded.
Your .gitattributes
12 rules generated
How to generate a .gitattributes file
Pick a preset or start from scratch
Choose a project-type preset such as Web, Node, Python, Unity, or Design assets, or leave everything off and build the file section by section.
Set line ending and binary rules
Turn on normalizing to LF, force a specific line ending for chosen extensions, and mark file types like images or archives as binary.
Add Git LFS and path exclusions
Select file types to track with Git LFS, and list vendored, generated, or export-ignore paths to keep them out of language stats and release archives.
Copy or download the file
Copy the generated .gitattributes to your clipboard or download it into the root of your repository.
Why use this tool
Project presets
Web, Node, Python, Unity, and Design assets presets fill in a sensible starting configuration in one click.
Line ending control
Normalize every text file to LF on commit, or force a specific ending for named extensions such as .sh or .bat.
Binary and Git LFS rules
Mark common file types as binary so they never get treated as text, and route large assets like design files or video through Git LFS.
Language stats and export exclusions
Keep vendored and generated folders out of the language breakdown, and leave test or CI files out of a git archive release.
Runs entirely in your browser
The file is assembled on your device; nothing about your project is uploaded.
About this tool
A .gitattributes file tells version control how to treat specific paths: which line ending to normalize to, which files are binary rather than text, which large files should be tracked with Git LFS instead of stored directly, and which folders should be left out of language statistics or a release archive. Getting all of this right by hand means remembering a handful of attribute names and their exact syntax for every path in a project.
This generator builds the file from toggles instead. Turn on normalizing line endings to add a single text=auto rule, or force LF or CRLF for named extensions when a project mixes editors and operating systems. Pick common binary types such as images, fonts, archives, or executables, and they are marked so they are never diffed or merged as text. Select file types to track with Git LFS, such as design files or video, and list any vendored or generated paths so they stay out of the language breakdown shown on code hosting sites.
A preset for Web, Node, Python, Unity, or Design assets fills in a working starting point for that kind of project, which you can then adjust section by section. When it looks right, copy the result or download it straight into the root of your repository. Everything runs locally, so nothing about your project ever leaves your device. Pair it with the .gitignore generator and .editorconfig generator when setting up a new repository.
Frequently asked questions
- What does a .gitattributes file do?
- It tells version control how to treat specific files and paths: how to normalize line endings, which files count as binary, which files should be tracked through Git LFS, and which paths to leave out of language statistics or an archive export.
- What does normalizing line endings do?
- Turning it on adds a `* text=auto` rule, which tells version control to store text files with a consistent line ending internally while still checking them out in the line ending each operating system expects.
- When should I mark a file as binary?
- Mark file types like images, fonts, archives, and compiled executables as binary so they are never shown as a line-by-line text diff or merged the way source code is, which avoids corrupting the file.
- What does Git LFS do here?
- Selecting a file type for Git LFS adds a rule that routes matching files through Git Large File Storage instead of storing them directly in history, which keeps a repository small when it contains large design files, video, or audio.
- What is the difference between linguist-vendored and export-ignore?
- linguist-vendored and linguist-generated keep a path out of the language percentage shown on code hosting sites. export-ignore keeps a path out of an archive created with git archive, such as a release zip, without affecting the repository itself.
- Is my project information uploaded anywhere?
- No. The file is generated entirely in your browser and nothing is sent to a server.
Related tools
.gitignore Generator
Build a clean .gitignore for your project from ready-made templates. Pick the languages, frameworks, build tools, editors, and operating systems you use, merge and dedupe overlapping patterns, add your own rules, then copy or download the file.
.editorconfig Generator
Build a valid .editorconfig for your project. Set the indent style, size, line endings, charset, and whitespace rules, add per file overrides, then copy or download the file.
File Hash & Checksum Tool
Compute a file MD5, SHA-1, SHA-256, and SHA-512 checksum, and verify it against an expected value.
HMAC Generator
Compute an HMAC of a message with your secret key using SHA-256, SHA-1, SHA-384, or SHA-512, in hex and Base64.
HTML Entity Encoder
Encode text to HTML entities and decode entities back to plain text, both directions.
HTML Minifier
Shrink HTML by removing comments and collapsing whitespace, while leaving preformatted text, inline scripts, and inline styles untouched. See the size saved.