# gitattributes

The [git attributes file](https://git-scm.com/docs/gitattributes) 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.

* [Github's Dealing with File Endings](https://help.github.com/articles/dealing-with-line-endings/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bernardo.gitbook.io/development-docs/git/configuration-files/gitattributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
