-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
.gitattributes
67 lines (48 loc) · 1.37 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
# Normalize line endings
* text=auto
# Markdown files
*.md text
*.markdown text
# JSON files
*.json text
*.json diff=json
# JavaScript files
*.js text
*.js diff=javascript
# CSS files
*.css text
*.css diff=css
# HTML files
*.html text
*.html diff=html
# YAML files
*.yml text
*.yaml text
# Images (binary)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.svg text
# Web fonts (binary)
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary
# Lock files (text but not normalized)
package-lock.json -text
yarn.lock -text
# Ignore minified files for diffs
*.min.js binary
*.min.css binary
# Exclude certain directories from diff
node_modules/ -diff
dist/ -diff
# Shell scripts
*.sh text eol=lf
#Explanation of the Key Entries:
text=auto: Ensures consistent end-of-line normalization (CRLF for Windows, LF for Unix-based systems).
Language-specific diff settings: Helps Git understand how to better display differences for files like JSON, JavaScript, or CSS.
Binary files: Ensures that image and font files are treated as binary, avoiding unintended modifications or corruption.
Lock files: Prevents normalization of files like package-lock.json or yarn.lock which should remain as-is.
Exclude directories: Prevents Git from processing changes in directories like node_modules or dist which contain generated files.