.gitattributes Generator
Generate .gitattributes files with line-ending rules, binary file handling, linguist-generated, and export-ignore patterns. Free, in-browser, no upload.
Loading tool...
What is .gitattributes Generator?
The .gitattributes Generator creates .gitattributes files from curated rule packs for line endings, popular languages, web assets, binary files, and GitHub extras like linguist attributes and export-ignore. It merges your selections, removes duplicate rules, and supports custom patterns β producing a ready-to-commit file that keeps your repository consistent across every OS.
Key Benefits
- Consistent line endings
- Binary files stay intact
- Cleaner diffs and reviews
- Accurate language stats
- Works offline
Common Use Cases
- β’Ending CRLF vs LF conflicts in mixed Windows/macOS/Linux teams
- β’Protecting images, fonts, and archives from Git corruption
- β’Hiding lockfiles and minified bundles from pull request diffs
- β’Trimming docs and tests from git archive release downloads
How to Use the .gitattributes Generator
- Pick rule packs: Select the packs that match your stack β Line Endings plus your languages, web assets, binaries, and GitHub extras.
- Add custom rules: Type any project-specific patterns in the Custom Rules box, one per line. Comments starting with # are kept.
- Review the preview: The merged .gitattributes appears on the right with duplicates removed automatically.
- Copy or download: Copy the file or download it as .gitattributes, then place it in your repository root and commit.
Key Features
- 18 curated rule packs: languages, web assets, binaries, GitHub extras
- Automatic line-ending normalization with * text=auto and per-type eol rules
- Marks images, fonts, media, and archives as binary so Git never mangles them
- linguist-generated and -diff rules shrink review noise from lockfiles
- export-ignore rules keep docs and tests out of source downloads
- Live merged preview with duplicate removal and custom rule support