|
| 1 | +# ============================================================================= |
| 2 | +# .gitattributes — going-forward Git LFS tracking and text/binary handling |
| 3 | +# ============================================================================= |
| 4 | +# |
| 5 | +# IMPORTANT: this file affects ONLY future `git add` operations. Existing |
| 6 | +# blobs in history are NOT migrated by these patterns. A separate, coordinated |
| 7 | +# `git lfs migrate import` (Phase 2) is required to actually relocate the |
| 8 | +# ~2 GB of binaries already in `.git`. See PR #(this PR) and issues #1393, |
| 9 | +# #1175 for the migration plan. |
| 10 | +# |
| 11 | +# `.gitignore` takes precedence over LFS tracking — if a file is ignored |
| 12 | +# (e.g., `.gitignore` exempts callout-icon PDFs from the global *.pdf rule), |
| 13 | +# `.gitattributes` LFS tracking will only apply if the file is actually being |
| 14 | +# staged. |
| 15 | + |
| 16 | +# ----------------------------------------------------------------------------- |
| 17 | +# Distribution / publish artefacts (large, infrequently changing, binary) |
| 18 | +# ----------------------------------------------------------------------------- |
| 19 | +# EPUB: zero currently tracked in HEAD; ~952 MB across 15 historical versions |
| 20 | +# in `assets/downloads/Machine-Learning-Systems.epub`. Mark for LFS so any |
| 21 | +# future re-add does not bloat .git. |
| 22 | +*.epub filter=lfs diff=lfs merge=lfs -text |
| 23 | + |
| 24 | +# PDF: covers TinyTorch-Guide.pdf, 00_tinytorch.pdf, distribution PDFs. |
| 25 | +# Note: `.gitignore` excludes most PDFs by default but explicitly allows |
| 26 | +# callout-icon PDFs, mlsysim docs, paper figures, etc. Those exempted PDFs |
| 27 | +# WILL be LFS-tracked under this pattern when newly added — that's the |
| 28 | +# intended behaviour: small icon PDFs are still small as LFS pointers, and |
| 29 | +# they are infrequently changed. |
| 30 | +*.pdf filter=lfs diff=lfs merge=lfs -text |
| 31 | + |
| 32 | +# ----------------------------------------------------------------------------- |
| 33 | +# Audio / video (always binary, never deltas well) |
| 34 | +# ----------------------------------------------------------------------------- |
| 35 | +# Two MP3 podcasts are currently tracked (~16 MB combined). Multiple sites |
| 36 | +# (book quarto, socratiQ, kits) may add more in future. |
| 37 | +*.mp3 filter=lfs diff=lfs merge=lfs -text |
| 38 | +*.wav filter=lfs diff=lfs merge=lfs -text |
| 39 | +*.m4a filter=lfs diff=lfs merge=lfs -text |
| 40 | +*.mp4 filter=lfs diff=lfs merge=lfs -text |
| 41 | +*.mov filter=lfs diff=lfs merge=lfs -text |
| 42 | +*.webm filter=lfs diff=lfs merge=lfs -text |
| 43 | + |
| 44 | +# ----------------------------------------------------------------------------- |
| 45 | +# Bundled JS / WASM artefacts (when ever tracked) |
| 46 | +# ----------------------------------------------------------------------------- |
| 47 | +# These are typically build outputs and SHOULD be ignored via .gitignore |
| 48 | +# rather than tracked (see `book/quarto/tools/scripts/socratiQ/bundle.js`, |
| 49 | +# the historical `scripts/ai_menu/dist/bundle.js`, and the Next.js |
| 50 | +# `staffml/_next/static/chunks/*.js` blobs). However, if a bundle ever does |
| 51 | +# need to be tracked (e.g., a vendored externally-published artefact), |
| 52 | +# treat it as binary so we don't burn diff cycles. |
| 53 | +*.wasm filter=lfs diff=lfs merge=lfs -text |
| 54 | + |
| 55 | +# ----------------------------------------------------------------------------- |
| 56 | +# NOT added to LFS (uncertainty / mixed-size patterns) — defer to VJ |
| 57 | +# ----------------------------------------------------------------------------- |
| 58 | +# *.png — repo mixes 1-5 MB cover art / kit photos with thousands of small |
| 59 | +# icon PNGs. A blanket pattern would LFS-track the small ones too. |
| 60 | +# Recommend either path-scoped patterns |
| 61 | +# (e.g. `book/quarto/assets/images/covers/**/*.png filter=lfs ...`) |
| 62 | +# or rasterizing big PNGs to a single canonical location first. |
| 63 | +# *.jpg / *.jpeg / *.gif — same mixed-size issue. The single biggest GIF is |
| 64 | +# `book/quarto/contents/vol1/introduction/images/gif/_alphafold.gif` |
| 65 | +# at 3 MB; most others are small. |
| 66 | +# *.json — `corpus.json`, `corpus-summary.json`, `search.json` are big but |
| 67 | +# they are build artefacts and already in `.gitignore`. JSON in |
| 68 | +# general should NOT be LFS-tracked (it's text and diffs well). |
| 69 | + |
| 70 | +# ----------------------------------------------------------------------------- |
| 71 | +# Text-handling normalization |
| 72 | +# ----------------------------------------------------------------------------- |
| 73 | +# Tell git to auto-normalize line endings on text files. Binary patterns |
| 74 | +# above already opt out via `-text`. |
| 75 | +* text=auto eol=lf |
| 76 | + |
| 77 | +# Shell scripts and Makefiles must keep LF on Windows checkouts. |
| 78 | +*.sh text eol=lf |
| 79 | +Makefile text eol=lf |
| 80 | + |
| 81 | +# Avoid CRLF translation for Windows-native batch files. |
| 82 | +*.bat text eol=crlf |
| 83 | +*.cmd text eol=crlf |
0 commit comments