Skip to content

Commit 70b85d5

Browse files
yrodieresebersole
authored andcommitted
Fix .gitattributes to only change line terminators on actual text files
1 parent b5221e2 commit 70b85d5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.gitattributes

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
* text eol=lf
1+
# By default, detect text files automatically, and use whatever line terminators make sense for the OS
2+
* text=auto
3+
4+
# Java files are text, and we want Java-friendly readable hunk headers for diff
5+
*.java text diff=java
6+
7+
# Force LF/CRLF format for files that are known to require it.
8+
*.sh text eol=lf
9+
*.bat text eol=crlf
10+
11+
# For some reason the above is not enough, in particular for gradlew.bat,
12+
# as some commands (git status, git add --renormalize) will still change its line endings to LF.
13+
# So, we explicitly tell git not to mess with *.bat line endings.
14+
# It's annoying as git won't show diffs for these files anymore,
15+
# but that's the best I could come up with after an hour of head-scratching.
16+
*.bat binary
17+

0 commit comments

Comments
 (0)