4541873431
As discussed in https://gitlab.com/gitlab-org/gitlab_git/issues/28 we'll need to clearly document the need for .gitattributes files being encoded using UTF-8. [ci skip]
22 lines
789 B
Markdown
22 lines
789 B
Markdown
# Git Attributes
|
|
|
|
GitLab supports defining custom [Git attributes][gitattributes] such as what
|
|
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
|
|
Byte Order Mark. If a different encoding is used, the file's contents will be
|
|
ignored.
|
|
|
|
## Syntax Highlighting
|
|
|
|
The `.gitattributes` file can be used to define which language to use when
|
|
syntax highlighting files and diffs. See ["Syntax
|
|
Highlighting"](highlighting.md) for more information.
|
|
|
|
[gitattributes]: https://git-scm.com/docs/gitattributes
|