-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitattributes
More file actions
127 lines (115 loc) · 3.46 KB
/
Copy path.gitattributes
File metadata and controls
127 lines (115 loc) · 3.46 KB
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
# CONFIGURATION FILE TO ALLOW GIT TO HANDLE LINE ENDINGS PROPERLY
# ('core.autocrlf' is NOT RECOMMENED, as it doesn't behave properly)
#
# Meaning of the most common options
# text=auto autodetect text files and convert CRLF -> LF
# text convert CRLF -> LF
# -text never perform the conversion
# text eol=crlf convert all to CRLF (for files that MUST retain CRLF even on Linux)
# text eol=lf convert all to LF (for files that MUST retain LF even on Windows)
# binary autodetect text files and don't touch them
#
# SOME NOTES:
# 1) all conversions apply while "uploading" to Git, when you "download" the
# files the LF gets converted to CRLF on Windows and to LF on Linux
# ("upload" = write to the object database in the .git folder)
# ("download" = write to the working directory)
#
# 2) ALWAYS specify the binary files explicitly to avoid data corruption
#
# More info:
# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
#
#
# IF YOU ADD THIS FILE AFTER THE CREATION OF THE REPO:
# "apply" the rules in the .gitattributes file to all the repo to ensure that
# all the files behaves as prescribed by the .gitattributes file by running
# git rm -rf --cached .
# git reset --hard HEAD
#
# Sources:
# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# https://dev.to/deadlybyte/please-add-gitattributes-to-your-git-repository-1jld
# BASIC .gitattributes FROM https://github.com/gitattributes/gitattributes
#
# Set the DEFAULT behaviour (if a file is not found in the list below, Git falls
# to the core.autocrlf setting, which is unreliable and not portable. To
# prevent this, define a default behaviour)
# always perform CRLF -> LF
* text=auto
#
# The above will handle all files NOT found below
#
# Documents
*.bibtex text diff=bibtex
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
# avoid noisy and potentially wrong conversion from pdf to plain text representation
#*.pdf diff=astextplain
#*.PDF diff=astextplain
*.pdf binary
*.PDF binary
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text diff=markdown
*.mdx text diff=markdown
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text eol=crlf
*.tab text
*.tsv text
*.txt text
*.sql text
*.epub diff=astextplain
# my addition:
*.bib text
# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as text by default.
#*.svg text
# If you want to treat it as binary,
# use the following line instead.
*.svg binary
*.eps binary
# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# Serialisation
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text
# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary
# Text files where line endings should be preserved
*.patch -text
#
# Exclude files from exporting
#
.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore