Git LFS
$ git-lfs Foundation Low RiskReplaces large binary assets inside Git repositories with lightweight text pointers while storing file contents on a remote LFS server. Agents use git lfs ls-files, git lfs status, and git lfs prune --dry-run to inspect and manage large-object storage safely.
brew install git-lfs Binary pointer resolution and local .git/lfs cache pruning are pure local Git operations with no MCP equivalent.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
git lfs <command> [<args>]
Git LFS is a system for managing and versioning large files in
association with a Git repository. Instead of storing the large files
within the Git repository as blobs, Git LFS stores special "pointer
files" in the repository, while storing the actual file contents on a
Git LFS server. The contents of the large file are downloaded
automatically when needed, for example when a Git branch containing the
large file is checked out.
Git LFS works by using a "smudge" filter to look up the large file
contents based on the pointer file, and a "clean" filter to create a new
version of the pointer file when the large file's contents change. It
also uses a pre-push hook to upload the large file contents to the Git
LFS server whenever a commit containing a new large file version is
about to be pushed to the corresponding Git server.
Commands
--------
Like Git, Git LFS commands are separated into high level ("porcelain")
commands and low level ("plumbing") commands.
High level porcelain commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
git lfs checkout:
Populate working copy with real content from Git LFS files.
git lfs completion:
Generate shell scripts for command-line tab-completion of Git LFS commands.
git lfs dedup:
De-duplicate Git LFS files.
git lfs env:
Display the Git LFS environment.
git lfs ext:
Display Git LFS extension details.
git lfs fetch:
Download Git LFS files from a remote.
git lfs fsck:
Check Git LFS files for consistency.
git lfs install:
Install Git LFS configuration.
git lfs lock:
Set a file as "locked" on the Git LFS server.
git lfs locks:
List currently "locked" files from the Git LFS server.
git lfs logs:
Show errors from the Git LFS command.
git lfs ls-files:
Show information about Git LFS files in the index
and working tree.
git lfs migrate:
Migrate history to or from Git LFS
git lfs prune:
Delete old Git LFS files from local storage
git lfs pull:
Fetch Git LFS changes from the remote & checkout any required working tree
files.
git lfs push:
Push queued large files to the Git LFS endpoint.
git lfs status:
Show the status of Git LFS files in the working
tree.
git lfs track:
View or add Git LFS paths to Git attributes.
git lfs uninstall:
Uninstall Git LFS by removing hooks and smudge/clean filter configuration.
git lfs unlock:
Remove "locked" setting for a file on the Git LFS server.
git lfs untrack:
Remove Git LFS paths from Git Attributes.
git lfs update:
Update Git hook FCRS-1.0 6-Dimension Breakdown
Deterministic non-interactive commands (ls-files, status --porcelain, locks --json), though most subcommands emit plain text rather than JSON.
git lfs ls-files --longandgit lfs status --porcelainprovide clean output- Lacks universal
--jsonacross most commands
Safe pointer model with --dry-run support on prune and migrate, and inherits Git credential isolation.
git lfs prune --dry-runandgit lfs migrate infoprevent blind mutations
Single static Go binary available via Homebrew and official packages across macOS, Linux, and Windows.
- Cross-platform binary installed via
brew install git-lfs
Solves large-file bloat in Git repos cleanly via transparent Git filter hooks.
- Handles pointer hydration and upload transparently on
gitcommands
Long-standing MIT project originally created by GitHub and maintained by Git LFS contributors.
- Active
git-lfs/git-lfsrepository under MIT license
Well-documented manpages and subcommand --help pages.
- Complete command manpages in
git-lfs/docs
Security, Auth & Guardrails
Inherits Git credential helpers and SSH authentication from the host repository; server overrides live in .lfsconfig.
MIT open-source CLI; remote LFS bandwidth and storage quotas depend on your Git host.
# Git LFS (git-lfs) Agent Rules - Run `git lfs track` before committing large binaries so files are not stored directly in Git history. - Always preview cache cleanup with `git lfs prune --dry-run` before running `git lfs prune`.
Agent-Ready Command Recipes
Safe Read-Only Queries
git lfs ls-files --long
Lists tracked LFS paths alongside their full SHA-256 object IDs without modifying the repo.
git lfs track
Prints currently configured .gitattributes LFS tracking rules.
Controlled Writes & Previews
git lfs prune --dry-run
Reports old local LFS objects eligible for pruning without deleting anything.
Strengths for Agents
- +
git lfs prune --dry-runandgit lfs migrate infolet agents inspect impact safely. - + Single Go binary integrates directly as a
git lfssubcommand. - + Reuses standard Git authentication with zero extra token setup.
Caveats & Pitfalls
- ! Only select commands like
git lfs locks --jsonemit JSON; most output plain text. - ! Forgetting
git lfs installleaves pointer files unhydrated in fresh containers.