-
Notifications
You must be signed in to change notification settings - Fork 115
/
.gitattributes
141 lines (111 loc) · 4.92 KB
/
.gitattributes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# code: language=gitattributes
######################################################################
# GITATTRIBUTES: Global
######################################################################
# See: https://www.git-scm.com/docs/gitattributes
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should not be diffed,
# normalized, etc. Only report if the file has changed.
# NOTE: "binary" is a macro for -diff -merge -text.
#
# Relevant builtin diff patterns (see: https://www.git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header)
# | Diff | Description |
# | ---------- | ------------------------------------------------------ |
# | `bash` | Bash language. |
# | | Covers a superset of POSIX shell functions. |
# | `css` | Cascading style sheets. |
# | `html` | HTML/XHTML documents. |
# | `markdown` | Markdown documents. |
# | `python` | Python language. |
# | `ruby` | Ruby language. |
# | `rust` | Rust language. |
# | `tex` | LaTeX documents. |
######################################################################
# ====================================================================
# MACROS #
# ====================================================================
# All macros assume the default rule is: `text eol=lf` and sets/removes attributes accordingly
# If the default rule changes, these macros must be updated as well.
# OVERRIDES
## See builtin binary definition here: https://www.git-scm.com/docs/gitattributes#_defining_macro_attributes
[attr]binary -text -diff -merge !eol
# CUSTOM
### Prevent end-of-line conversion
[attr]input -text -eol
## Diff Macros
### Useful for declaring which diff pattern to use for files that may
### not be captured correctly by Git's heuristics.
[attr]bash diff=bash
[attr]css diff=css
[attr]html diff=html
[attr]xml diff=html
[attr]markdown diff=markdown
[attr]python diff=python
[attr]ruby diff=ruby
[attr]scheme diff=scheme
### Do not generate a diff, instead print a "Binary files differ" message
### Useful for autogenerated text files that may produce large, noisy diffs
[attr]autogen -diff
[attr]lockfile -diff
### Fix syntax highlighting on GitHub to allow comments
[attr]jsonc linguist-language=JSON-with-Comments
######################################################################
# ====================================================================
# RULES
# ====================================================================
# --------------------------------------------------------------------
# DEFAULT RULE
# --------------------------------------------------------------------
# Auto detect text files and perform LF normalization
* text eol=lf
# --------------------------------------------------------------------
# PATTERN RULES
# --------------------------------------------------------------------
# Common settings that generally should always be used with your language specific settings
# Text files where line endings should be preserved
*.patch -text
# Assets
## Graphics
*.gif binary
*.ico binary
*.jpeg binary
*.jpg binary
*.png binary
*.tif binary
*.tiff binary
*.webp binary
*.svgz binary
## Fonts
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
# These are explicitly windows files and should use crlf
*.bat eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# Uncommon (to Git) sourcecode files
*.scss text css
# Fix syntax highlighting on GitHub to allow comments
tsconfig.json jsonc
# Lock files (usually for managing project dependencies)
*.lock lockfile
# Auto-generated and minified files
*.map autogen
*.min.js autogen
# --------------------------------------------------------------------
# PROJECT-SPEFICIC RULES
# --------------------------------------------------------------------#
## Lock files
package-lock.json lockfile
pnpm-lock.yaml lockfile
### Force text diff for specific lockfiles
Gemfile.lock diff
yarn.lock diff
knapsack_rspec_report.json jsonc
## Executables and runtimes
*.wasm binary
## Data files
*_model-shard? binary