Free GitAttributes File Generator & Line Ending Normalizer

Free GitAttributes File Generator & Line Ending Normalizer
gemini-3.0-flash logogemini-3.0-flash

Easily generate and validate .gitattributes files for consistent LF and CRLF line ending normalization. Fix cross-platform Git repository issues with this free tool.

Built by@Akhenaten

What This App Does

Easily generate and validate .gitattributes files for consistent LF and CRLF line ending normalization. Fix cross-platform Git repository issues with this free tool. — generated by gemini-3.0-flash and published by @Akhenaten on Slopstore. Categorized under Utility, this app is part of Slopstore's curated collection of AI-generated tools and experiments. Run it free in your browser. No installation needed.

AI Generation Prompt

Technical Specification: GitAttributes Line Ending Normalizer

Overview

A single-file, browser-based utility that enables developers to generate, preview, and configure a valid .gitattributes file. The tool prevents common cross-platform Git issues caused by disparate line endings (LF vs CRLF).

Core Features

  1. Preset Selector: One-click configuration presets for:
    • Standard Web Project (Defaulting to LF for JS/CSS/HTML).
    • Windows-Native Project (Defaulting to CRLF).
    • Cross-Platform/Universal (Safe defaults).
  2. Custom Rule Editor: A dynamic list interface to add specific rules for file extensions (e.g., *.ps1 text eol=crlf, *.sh text eol=lf).
  3. Real-Time Preview: A syntax-highlighted code block that updates instantly as options are toggled.
  4. Copy-to-Clipboard: A robust, UI-feedback-driven copy mechanism.
  5. Implementation Guide: A collapsible "How to Apply" section that explains the git add --renormalize workflow.
  6. Validation: Basic syntax checking to ensure no invalid characters or patterns are included.

UI/UX Design

  • Aesthetic: SaaS-professional, clean white/gray background (#f8fafc), high-contrast dark text (#1e293b). Use soft drop shadows (shadow-sm) for content cards.
  • Color Palette:
    • Primary: Deep Blue (#2563eb) for action buttons.
    • Accent: Success Green (#16a34a) for copy confirmation.
    • Border: Neutral Gray (#e2e8f0).
  • Layout:
    • Header: Large, clear title and subtitle.
    • Main Content Area: Two-column layout on desktop (Configuration settings on left, generated code on right). Stacks vertically on mobile.
    • No Footer: Entirely self-contained in a single view.
  • Micro-interactions: Smooth transitions on hover states (transition-all duration-200). Fade-in animations for new rule additions.

Technical Directives

  1. Architecture: Single HTML file containing embedded CSS and Vanilla JS. No external build steps.
  2. State Management: Use plain JS objects to manage the rule list. No localStorage or sessionStorage. All state resets on refresh.
  3. Security/Compliance:
    • No alert() or prompt(). Use a custom, floating Toast notification for copy successes or validation errors.
    • Sandboxed Iframe compatible: Zero external dependencies that require cookies or storage persistence.
    • External links must use rel="noopener noreferrer".
  4. Responsiveness: Use Flexbox and CSS Grid to ensure the tool is usable on mobile devices, tablets, and wide-screen monitors.
  5. Dependencies: Use CDN links for Tailwind CSS (via script tag) for rapid, consistent styling without local files.

Spread the word

7Total Views
gemini-3.0-flash logogemini-3.0-flash
AI Model

Files being used

index.html
10.8 KB
#gitattributes generator#git line ending normalizer#git lf vs crlf settings#cross-platform git configuration#git attributes editor#fix git line endings

Frequently Asked Questions

Everything you need to know about using this application.

Why do I need a .gitattributes file in my project?

A .gitattributes file is essential for ensuring consistent file handling across different operating systems, particularly regarding line endings. When contributors use different platforms like Windows (CRLF) and macOS or Linux (LF), Git can incorrectly report files as modified, or introduce inconsistent line endings into the repository history. By explicitly defining these rules, you force Git to normalize line endings during the checkout and commit processes. This prevents unnecessary 'diff' noise in your pull requests and ensures that your project maintains a clean, uniform codebase regardless of the environment your contributors are using.

What is the difference between LF and CRLF in Git repositories?

LF (Line Feed) is the standard line ending used on Unix-based systems like Linux and macOS. It is represented by a single character (\n). Conversely, CRLF (Carriage Return + Line Feed) is the legacy standard used by Windows, represented by two characters (\r\n). These fundamental differences can cause significant friction in collaborative development workflows. If Git does not properly normalize these endings, a developer on Windows might commit a file that looks completely different to a developer on macOS, even if the actual content of the code is identical. This often leads to frustrating 'merge conflicts' and repository bloat that complicate the development process.

How does this generator tool handle line endings safely?

This generator provides a user-friendly interface to build the correct 'text eol=lf' or 'text eol=crlf' configuration rules tailored to your project's specific needs. It adheres to the official Git documentation standards, ensuring that you apply normalization selectively to source code files while protecting binary files from potential corruption. Once generated, you can simply copy the resulting content into a file named '.gitattributes' at the root of your repository. The tool also provides clear instructions on how to use 'git add --renormalize .' to immediately update your existing repository history to match the new configuration rules.

Can I use this tool for projects other than Git?

While this specific tool is designed to generate the proprietary syntax used for the Git version control system, the principles of line ending normalization are universal in software engineering. However, the configuration output generated here is exclusively formatted for the Git environment and will not function in other version control systems or build tools. If you are using a different version control system, you should consult that specific tool's documentation for its unique line ending handling mechanisms. This generator is optimized strictly for professional Git-based workflows, ensuring high-accuracy output for standard repository configurations.

Related Applications

Discover more free AI apps on Slopstore — the community platform for hosting AI-generated web applications.