Skip to content

git-lfs-pointer

worktree

repo with a Git LFS pointer file committed for a binary asset (no lfs binary required)

A binary asset (`assets/blob.bin`) is tracked by Git LFS. The file on
disk is the plain-text *pointer stub* — the real binary object would
live on an LFS server that this scenario does not configure.

`.gitattributes` marks `*.bin` with `filter=lfs diff=lfs merge=lfs -text`.
The `-text` attribute is required to prevent CRLF mangling of the pointer
text on Windows.

Platform notes:
  - No `git-lfs` binary is needed — the pointer is written as plain text,
    so the scenario passes everywhere without the LFS extension installed.
  - Tools that call `git lfs checkout` or `git lfs pull` will fail unless
    `git-lfs` is installed; test only pointer detection and attribute rules.
  - The oid and size in `assets/blob.bin` are hardcoded constants and do
    not correspond to any real LFS object.

Useful for testing:
  - LFS pointer detection ("is this file an LFS pointer?")
  - UI badges or warnings for LFS-managed paths
  - `.gitattributes` rule parsing (`filter=lfs`, `diff=lfs`, `-text`)
  • main is checked out
  • main has 2 commits
  • .gitattributes marks *.bin as LFS-tracked (filter=lfs diff=lfs merge=lfs -text)
  • assets/blob.bin contains a canonical LFS pointer (version + oid sha256 + size)
  • worktree is clean
lfsencodinggitattributescross-platform
main
import { spinUpScenario } from '@gfargo/git-scenarios'

const repo = await spinUpScenario('git-lfs-pointer')
* b7b3122 (HEAD -> main) feat: add lfs-tracked binary asset
* 7520170 chore: initial

Back to Scenario Browser