gitattributes: force '* -text' so clones restore byte-exact regardless of core.autocrlf

Git-for-Windows defaults core.autocrlf=true, which expanded LF->CRLF on checkout in a
test clone (69 text files differed). '* -text' makes the repo self-enforcing: no EOL
conversion on any machine. Added 'diff' overrides so source still diffs as text.
This commit is contained in:
Cyd
2026-06-24 22:18:28 -05:00
parent 2b8ca921cb
commit 4c6b8345c8
+33 -3
View File
@@ -5,6 +5,12 @@
# Anything binary NOT listed here still commits fine (just not LFS-optimized) — the
# post-stage size check catches large stragglers.
# ---- Byte-for-byte mirror: NO end-of-line conversion on ANY machine ----
# This overrides each cloner's global core.autocrlf (Git-for-Windows defaults it to true,
# which would expand LF->CRLF on checkout). With `* -text`, git never converts EOLs, so a
# clone restores files exactly as committed. `diff` overrides below keep source readable.
* -text
# ---- Game/art assets ----
*.tga filter=lfs diff=lfs merge=lfs -text
*.bmp filter=lfs diff=lfs merge=lfs -text
@@ -75,6 +81,30 @@
*.db filter=lfs diff=lfs merge=lfs -text
*.mr filter=lfs diff=lfs merge=lfs -text
# NOTE: intentionally NO `text`/eol attributes. This is a byte-for-byte mirror — with
# core.autocrlf=false and no text attrs, git stores/restores text files exactly as-is
# (no LF<->CRLF conversion) and still auto-detects text for diffs. Do not add `text` here.
# ---- Readable diffs for text/source (force textual diff; `-text` above still prevents
# any EOL conversion, so byte-exactness is preserved) ----
*.cpp diff
*.hpp diff
*.h diff
*.c diff
*.inl diff
*.idl diff
*.rc diff
*.def diff
*.dsp diff
*.dsw diff
*.mak diff
*.script diff
*.build diff
*.instance diff
*.contents diff
*.subsystems diff
*.abl diff
*.abi diff
*.hint diff
*.txt diff
*.md diff
*.ps1 diff
*.bat diff
*.reg diff
*.h diff