# gitattributes/gitattributes

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/gitattributes-gitattributes).**

3,814 stars · 592 forks · Git Attributes · MIT

## Links

- GitHub: https://github.com/gitattributes/gitattributes
- awesome-repositories: https://awesome-repositories.com/repository/gitattributes-gitattributes.md

## Topics

`git` `gitattributes` `gitattributes-templates`

## Description

This project is a library of standardized specifications and templates for managing version control attributes, line ending normalization, and language-aware diff strategies. It provides a framework for defining how a version control system treats specific file extensions to ensure cross-platform consistency and prevent file corruption.

The project distinguishes itself by offering a comprehensive configuration library for managing binary files, diff drivers, and repository metadata. It includes specialized diff strategy management and a repository metadata standard that maps custom file extensions to programming languages for correct syntax highlighting and identification.

The capability surface covers line ending management to enforce consistent end-of-line characters across operating systems and file handling rules that designate assets as either text or binary. It also includes language-specific configurations for various programming languages, metadata management for syntax mapping, and storage optimization strategies to redirect large binary assets to external storage.

A command-line utility is provided to scan project files and verify attribute coverage, ensuring all assets are governed by the necessary configuration rules.

## Tags

### Development Tools & Productivity

- [Line Ending Standards](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/code-formatting-utilities/formatting-rules/line-ending-standards.md) — Enforces consistent end-of-line characters across different operating systems through automated conversion during commit and checkout.
- [Diff Routing Configurations](https://awesome-repositories.com/f/development-tools-productivity/diff-routing-configurations.md) — Assigns specialized diffing algorithms to specific file extensions to optimize the visualization of code changes.
- [Diff Strategy Managers](https://awesome-repositories.com/f/development-tools-productivity/diff-strategy-managers.md) — Provides a configuration resource for assigning language-aware diffing algorithms to improve change readability.
- [Language-Aware Diff Configurations](https://awesome-repositories.com/f/development-tools-productivity/language-aware-diff-configurations.md) — Assigns specialized diffing algorithms to specific programming languages to improve the readability of code changes.
- [Syntax Mapping Metadata](https://awesome-repositories.com/f/development-tools-productivity/syntax-mapping-metadata.md) — Assigns programming language identifiers to custom file extensions to enable correct syntax highlighting.
- [Text Normalization](https://awesome-repositories.com/f/development-tools-productivity/version-control-configurations/text-normalization.md) — Configures automatic line-ending normalization and language-specific diff drivers to ensure consistent version control. ([source](https://github.com/gitattributes/gitattributes/blob/master/Rust.gitattributes))
- [Git Attribute Configurations](https://awesome-repositories.com/f/development-tools-productivity/version-control-repository-tools/version-control-managers/repository-utilities/repository-configuration-utilities/git-attribute-configurations.md) — Offers a collection of standardized .gitattributes templates for managing line endings, binary files, and diff drivers.
- [Attribute Coverage Scanners](https://awesome-repositories.com/f/development-tools-productivity/attribute-coverage-scanners.md) — Provides a CLI utility to scan projects and identify files lacking necessary configuration rules.
- [Attribute Coverage Verifiers](https://awesome-repositories.com/f/development-tools-productivity/cli-verification-tools/attribute-coverage-verifiers.md) — Provides a CLI utility that scans project files to identify those lacking configuration rules. ([source](https://github.com/gitattributes/gitattributes#readme))
- [Whitespace Enforcement](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/code-formatting-utilities/formatting-rules/line-ending-standards/whitespace-enforcement.md) — Enforces consistent line endings and whitespace rules across text files to prevent formatting discrepancies. ([source](https://github.com/gitattributes/gitattributes/blob/master/Drupal.gitattributes))
- [Custom Diff Tool Assignments](https://awesome-repositories.com/f/development-tools-productivity/custom-diff-tool-assignments.md) — Allows the assignment of specialized diffing algorithms to specific file extensions for better readability of changes. ([source](https://github.com/gitattributes/gitattributes/blob/master/Common.gitattributes))
- [Diff Operation Definitions](https://awesome-repositories.com/f/development-tools-productivity/diff-operation-definitions.md) — Specifies how different file types are compared and displayed during diff operations to improve readability. ([source](https://github.com/gitattributes/gitattributes/blob/master/Web.gitattributes))
- [Archive Export Exclusions](https://awesome-repositories.com/f/development-tools-productivity/version-control-repository-tools/repository-documentation-generators/file-exclusion-policies/archive-export-exclusions.md) — Allows marking internal configuration and metadata files for exclusion when generating project archives. ([source](https://github.com/gitattributes/gitattributes/blob/master/Common.gitattributes))

### Repository Format

- [Attribute Template Libraries](https://awesome-repositories.com/f/repository-format/attribute-template-libraries.md) — Provides a comprehensive library of standardized attribute templates for managing how files are handled by version control. ([source](https://github.com/gitattributes/gitattributes#readme))
- [Attribute Mapping Rules](https://awesome-repositories.com/f/repository-format/attribute-mapping-rules.md) — Maps file extensions to specific version control attributes using a set of predefined matching rules.
- [Binary Attribute Management](https://awesome-repositories.com/f/repository-format/binary-attribute-management.md) — Marks specific file extensions as binary to prevent text-based corruption and enable proper binary diffing. ([source](https://github.com/gitattributes/gitattributes/blob/master/Drupal.gitattributes))
- [Binary-Text Designation Rules](https://awesome-repositories.com/f/repository-format/binary-text-designation-rules.md) — Implements a system to categorize files as text or binary to prevent corruption and optimize merge strategies.
- [File Attribute Assignments](https://awesome-repositories.com/f/repository-format/file-attribute-assignments.md) — Specifies how file types are handled by assigning text or binary markers and defining custom diff logic. ([source](https://github.com/gitattributes/gitattributes/blob/master/Lua.gitattributes))
- [File Handling Rule Definitions](https://awesome-repositories.com/f/repository-format/file-handling-rule-definitions.md) — Defines how a version control system treats specific file extensions by designating them as text or binary. ([source](https://github.com/gitattributes/gitattributes/blob/master/C%2B%2B.gitattributes))
- [File Type Identification](https://awesome-repositories.com/f/repository-format/file-type-identification.md) — Specifies how version control systems identify and handle file types to ensure consistent language detection. ([source](https://github.com/gitattributes/gitattributes/blob/master/Markdown.gitattributes))
- [Language Labeling](https://awesome-repositories.com/f/repository-format/language-labeling.md) — Assigns specific language labels to files so version control systems categorize and highlight them correctly. ([source](https://github.com/gitattributes/gitattributes/blob/master/TinaCMS.gitattributes))
- [Text and Binary Designations](https://awesome-repositories.com/f/repository-format/text-and-binary-designations.md) — Defines which files are treated as text or binary and specifies the appropriate diffing tool for source code. ([source](https://github.com/gitattributes/gitattributes/blob/master/Matlab.gitattributes))
- [VCS File Attribute Specifications](https://awesome-repositories.com/f/repository-format/vcs-file-attribute-specifications.md) — Defines rules for how Git treats specific file extensions to ensure cross-platform consistency and prevent corruption.
- [VCS File Handling Specifications](https://awesome-repositories.com/f/repository-format/vcs-file-handling-specifications.md) — Defines whether specific file extensions are treated as text or binary to manage merges and storage.
- [External Asset Storage](https://awesome-repositories.com/f/repository-format/external-asset-storage.md) — Directs large assets and binary files to external storage to prevent repository bloat. ([source](https://github.com/gitattributes/gitattributes/blob/master/Unity.gitattributes))
- [Go Attributes](https://awesome-repositories.com/f/repository-format/file-attribute-assignments/go-attributes.md) — A configuration that treats Go files as binary to prevent automatic line-ending conversions and ensure consistent line-feed handling across operating systems. ([source](https://github.com/gitattributes/gitattributes/blob/master/Go.gitattributes))
- [Java Rules](https://awesome-repositories.com/f/repository-format/file-handling-rule-definitions/java-rules.md) — A configuration defining how specific file extensions are treated regarding line endings, text normalization, and diffing for Java-based projects. ([source](https://github.com/gitattributes/gitattributes/blob/master/Java.gitattributes))
- [Pascal Rules](https://awesome-repositories.com/f/repository-format/file-handling-rule-definitions/pascal-rules.md) — A configuration defining which Pascal files are treated as text or binary and applying language-specific diffing to improve version control visibility. ([source](https://github.com/gitattributes/gitattributes/blob/master/Pascal.gitattributes))
- [Perl Specifications](https://awesome-repositories.com/f/repository-format/file-handling-rule-definitions/perl-specifications.md) — A configuration specifying that Perl source files are treated as text and use a language-specific diff algorithm for cleaner version control history. ([source](https://github.com/gitattributes/gitattributes/blob/master/Perl.gitattributes))
- [Python Specifications](https://awesome-repositories.com/f/repository-format/file-handling-rule-definitions/python-specifications.md) — A configuration defining text, binary, and line-ending attributes for Python files to ensure consistent diffs and prevent binary corruption. ([source](https://github.com/gitattributes/gitattributes/blob/master/Python.gitattributes))
- [Large File Storage (LFS)](https://awesome-repositories.com/f/repository-format/large-file-storage-lfs.md) — Marks large binary assets for external storage to prevent repository bloat and maintain performance.
- [PHP Specifications](https://awesome-repositories.com/f/repository-format/vcs-file-handling-specifications/php-specifications.md) — A configuration defining line ending normalization, text detection, and language-specific diffing for PHP files to ensure cross-platform consistency. ([source](https://github.com/gitattributes/gitattributes/blob/master/PHP.gitattributes))
- [Swift Specifications](https://awesome-repositories.com/f/repository-format/vcs-file-handling-specifications/swift-specifications.md) — A configuration defining how Swift source and project files are treated to ensure correct line endings and specialized diffing for merges. ([source](https://github.com/gitattributes/gitattributes/blob/master/Swift.gitattributes))

### Part of an Awesome List

- [Syntax Highlighting Rules](https://awesome-repositories.com/f/awesome-lists/devtools/file-managers/syntax-highlighting-rules.md) — Maps custom or uncommon file extensions to programming language identifiers for correct syntax highlighting. ([source](https://github.com/gitattributes/gitattributes/blob/master/DyalogAPL.gitattributes))

### Software Engineering & Architecture

- [Syntax-Aware Diffing](https://awesome-repositories.com/f/software-engineering-architecture/syntax-aware-diffing.md) — Associates specific file extensions with language-aware diffing tools to improve the readability of version control changes. ([source](https://github.com/gitattributes/gitattributes/blob/master/Elixir.gitattributes))
- [Configuration Templates](https://awesome-repositories.com/f/software-engineering-architecture/configuration-templates.md) — Uses a library of standardized attribute templates to ensure consistent file handling across languages and platforms.
- [Cross-Platform Development Utilities](https://awesome-repositories.com/f/software-engineering-architecture/cross-platform-development-utilities.md) — Standardizes file attributes and syntax mapping to ensure consistent behavior across diverse developer machines.
- [Ruby Strategies](https://awesome-repositories.com/f/software-engineering-architecture/diffing-algorithms/diffing-rule-definitions/ruby-strategies.md) — A set of language-specific diffing and merge strategies for Ruby projects to ensure consistent version control behavior across files. ([source](https://github.com/gitattributes/gitattributes/blob/master/Rails.gitattributes))

### DevOps & Infrastructure

- [Language Mapping Standards](https://awesome-repositories.com/f/devops-infrastructure/repository-management/repository-metadata-management/language-mapping-standards.md) — Provides a framework for mapping custom file extensions to programming languages for correct syntax highlighting.
