Skip to content

Commit 5977f93

Browse files
committed
Pin text files to LF in the working tree, not just the repository
.gitattributes carried a bare 'text=auto', which normalizes to LF on commit but leaves the checkout to follow core.autocrlf. That is set to true system-wide by a default Git for Windows install, so Git intended to rewrite every file as CRLF on the next checkout -- the state GitHub Desktop was reporting. Adding eol=lf fixes the checkout ending explicitly and takes precedence over core.autocrlf, so the working tree stays LF on every machine without asking contributors to change their global Git config. Python and Blender read LF without complaint on Windows. Binary formats are marked so Git never inspects or rewrites them.
1 parent 1185867 commit 5977f93

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

‎.gitattributes‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto
1+
# Store every text file as LF in the repository AND check it out as LF.
2+
# `eol=lf` is what makes this stick: without it the checkout follows the
3+
# machine's core.autocrlf, which is `true` on a default Git for Windows
4+
# install and rewrites these files as CRLF. Python and Blender read LF fine on
5+
# Windows, so pinning LF keeps the working tree byte-identical on every OS.
6+
* text=auto eol=lf
7+
8+
# Binaries: never inspected for line endings, never rewritten.
9+
*.blend binary
10+
*.blend1 binary
11+
*.blend2 binary
12+
*.step binary
13+
*.stp binary
14+
*.STEP binary
15+
*.STP binary
16+
*.obj binary
17+
*.png binary
18+
*.jpg binary
19+
*.jpeg binary
20+
*.exr binary
21+
*.hdr binary
22+
*.zip binary

0 commit comments

Comments
 (0)