2020-10-24 23:57:45 +05:30
---
stage: Create
group: Source Code
2021-02-22 17:27:13 +05:30
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments"
2020-10-24 23:57:45 +05:30
type: reference
---
2021-03-11 19:13:27 +05:30
# Git Attributes **(FREE)**
2016-11-03 12:29:30 +05:30
2020-05-24 23:13:21 +05:30
GitLab supports defining custom [Git attributes ](https://git-scm.com/docs/gitattributes ) such as what
2016-11-03 12:29:30 +05:30
files to treat as binary, and what language to use for syntax highlighting
diffs.
To define these attributes, create a file called `.gitattributes` in the root
directory of your repository and push it to the default branch of your project.
## Encoding Requirements
The `.gitattributes` file _must_ be encoded in UTF-8 and _must not_ contain a
2021-04-17 20:07:23 +05:30
Byte Order Mark. If a different encoding is used, the file's contents are
2016-11-03 12:29:30 +05:30
ignored.
## Syntax Highlighting
The `.gitattributes` file can be used to define which language to use when
2022-10-11 01:57:18 +05:30
syntax highlighting files and diffs. See
2022-08-27 11:52:29 +05:30
["Syntax Highlighting" ](highlighting.md ) for more information.