Development docs
  • Introduction
  • General information
    • Development Ecosystem
    • Documentation
    • Testing
    • Continuous Integration
    • Code Style
    • Paradigms
    • Design Patterns
    • Architecture
    • Refactoring
    • Date Formats
  • Various
    • Technologies and services
      • Travis
      • GitHub
    • Databases
      • Database Kinds
      • Style Guide
      • Joins
    • Web
      • Template View
      • Interactive View
      • Open Graph
      • Twitter Card
    • Parsers
    • Regular Expression
    • File Formats
      • Properties
    • Logging
  • git
    • Configuration files
      • gitignore
      • gitattributes
    • Gitflow
    • Tools
  • Web
    • REST
    • SOAP
  • Architecture
    • SOA
  • Object Oriented Programming
    • Returns
  • Jenkins
    • Pipeline
      • Steps
      • Environment
      • Notifications
      • Scripts
  • Java
    • Environment
      • Development Ecosystem
      • IDE
    • General
    • Interfaces and Generics for a Service
      • Dependencies
      • Type Errors
      • Nested Type Errors
    • Creating New Instances Dynamically
      • Using Classes
      • Using Providers
Powered by GitBook
On this page

Was this helpful?

  1. git
  2. Configuration files

gitattributes

PreviousgitignoreNextGitflow

Last updated 5 years ago

Was this helpful?

The maps file extensions to content types. This way, for example, it is possible telling git that the xml extension is used only for text files and never for binaries.

Actually it is more like a set of hints than a configuration file, and can make it easier working with several formats.

# Known text files
*.css           text diff=css
*.java          text diff=java eol=crlf
*.js            text eol=crlf
*.json          text

The previous example is mapping several extensions as text files. But it is also telling how to inspect changes, and which end of line character should be used.

This is saying that changes in CSS files should be inspected using CSS rules:

*.css           text diff=css

This is setting up the end of line conversion for Javascript files to CRLF:

*.js            text eol=crlf

It can contain global configuration too.

This defaults all files to text files, and normalizes line endings:

text=auto

Line endings

Line endings can give lots of problems when working in a team. Always normalize them.

git attributes file
Github's Dealing with File Endings