Every Git repository has a story about line endings: one developer works on macOS and checks in LF, a teammate on Windows checks out and edits on CRLF, and before long a pull request shows a false diff on every line of a file that only "changed" its newline bytes. The .gitattributes file is the machine-readable contract that prevents this class of problem, and it does far more besides: it tells Git which files are binary so they are never corrupted by text conversion, which files should merge by taking every version, how GitHub detects languages, and which paths to exclude when a release archive is built with git archive.
This generator assembles a professional .gitattributes file from a small number of well-understood groups. Automatic text detection writes the standard * text=auto marker so Git decides text versus binary intelligently. The binary group spells out common formats — images, archives, fonts, executables, media — with the binary attribute so none of them are ever touched by line-ending conversion. Line-ending groups then decide the checkout convention: force LF everywhere, force CRLF, or keep the native setting, with dedicated rules for shell scripts and batch files that already expect a specific style. Each group is a heading-and-lines block with a readable comment, so the exported file stays documented even when it grows.
Beyond endings, the merge and diff groups save real time in busy repositories. Files marked merge=union — package-lock.json, yarn.lock, Cargo.lock, composer.lock, poetry.lock, Gemfile.lock and CHANGELOG.md among them — resolve against each other by keeping both versions, so routine dependency bumps stop producing merge conflicts. Diff drivers for PDF, Office documents, notebooks and gettext files prepare the ground for external diff tools when they are configured in .git/config. The linguist group keeps GitHub statistics honest: you can pin a language to a file type, mark vendored third-party code so it is excluded from language counts, and hide generated files and documentation from the popular-language view.
The export-ignore group finishes the file for distribution: paths such as .github, docs, tests, .gitignore and the attributes file itself are stripped from git archive output, so release tarballs ship only real source. A custom-lines box appends your own rules under a dedicated section, and duplicate removal keeps the result compact when groups share entries. Statistics report how many groups are active, how many lines the file spans and how many actual attribute rules it holds — non-comment, non-blank lines only — so you always know what the file does before you commit it.
Everything happens in the browser: attribute lists are bundled with the page, generation is pure JavaScript, and no network request is made. Click Load sample to see a typical mixed repository configuration, or clear everything and build your own stack group by group. When the preview looks right, copy it to the clipboard or download it as .gitattributes, place it in the repository root, and commit it — from then on every contributor and every archive shares the same rules, and the silent line-ending emergencies of the past stay resolved.