GIT-LFS-TRACK(1)
π NAME π
git-lfs-track β View or add Git LFS paths to Git attributes. Welcome to the GIT-LFS-TRACK(1) page, bestie β this is the track-list corner of the git-lfs(1) suite, and weβre gonna make it make sense π
β¨ SYNOPSIS β¨
git lfs track [options] [<pattern>...]
π¦ DESCRIPTION π¦
Okay so git lfs track starts tracking the pattern(s) you give it through Git LFS. The argument is written to .gitattributes. If no paths are provided, it simply lists the currently-tracked paths. Low-effort, high-utility, iconic.
The gitattributes documentation at https://git-scm.com/docs/gitattributes states that patterns use the gitignore pattern rules at https://git-scm.com/docs/gitignore to match paths. This means patterns which contain *, ?, and the bracket characters [ and ] are treated specially; to disable this behavior and treat them literally instead, use --filename or escape the character with a backslash.
π OPTIONS π
-v,--verboseβ When enabled,git lfs tracklogs files which it will touch. Disabled by default.-d,--dry-runβ When enabled, havegit lfs tracklog all actions it would normally take (adding entries to.gitattributes, touching files on disk, etc) without performing any mutative operations to the disk.git lfs track --dry-run [files]also implicitly mocks the behavior of passing--verbose, and will log in greater detail what it is doing. Disabled by default.-j,--jsonβ Writes the currently tracked patterns as JSON to STDOUT, if the command exits successfully. Intended for interoperation with external tools. Can not be combined with any<pattern>arguments. If--no-excludedis also provided, that option will have no effect.--filenameβ Treat the arguments as literal filenames, not as patterns. Any special glob characters in the filename will be escaped when writing the.gitattributesfile.-l,--lockableβ Make the paths'lockable', meaning they should be locked to edit them, and will be made read-only in the working copy when not locked.--not-lockableβ Remove the lockable flag from the paths so they are no longer read-only unless locked.--no-excludedβ Do not list patterns that are excluded in the output; only list patterns that are tracked.--no-modify-attrsβ Makes matched entries stat-dirty so that Git can re-index files you wish to convert to LFS. Does not modify any.gitattributesfile(s).
π EXAMPLES π
- List the patterns that Git LFS is currently tracking:
git lfs track
- Configure Git LFS to track GIF files:
git lfs track "*.gif"
- Configure Git LFS to track PSD files and make them read-only unless locked:
git lfs track --lockable "*.psd"
- Configure Git LFS to track the file named project [1].psd:
git lfs track --filename "project [1].psd"
π SEE ALSO π
Part of the git-lfs(1) suite.
Bye bestie π this was GIT-LFS-TRACK(1) from the git-lfs(1) suite β source/version and date werenβt printed in the original footer (itβs just the manual name), so no extra line to copy, and Iβm not making one up πβ¨
π¦ where this page comes from
- arch rolling: git-lfs 3.8.1-1 Β· MIT
- nixos 26.05: git-lfs 3.8.1
- nixpkgs unstable: git-lfs 3.8.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms