git-lfs
Name
git-lfs — Git LFS — large file storage for git
Synopsis
git-lfs [COMMAND]
Description
Git LFS — large file storage for git
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.
Options
Flags
-V,--versionPrint the version banner and exit
Subcommands
clean— Git clean filter that converts large files to pointerssmudge— Git smudge filter that converts pointer in blobs to the actual contentinstall— Install Git LFS configurationuninstall— Remove Git LFS configurationtrack— View or add Git LFS paths to Git attributesuntrack— Remove Git LFS paths from Git attributesfilter-process— Git filter process that converts between pointer and actual contentfetch— Download all Git LFS files for a given refpull— Download all Git LFS files for current ref and checkoutpush— Push queued large files to the Git LFS endpointclone— Efficiently clone a LFS-enabled repositorypost-checkout— Git post-checkout hook implementationpost-commit— Git post-commit hook implementationpost-merge— Git post-merge hook implementationpre-push— Git pre-push hook implementationversion— Print the git-lfs version banner and exitpointer— Build, compare, and check pointersenv— Display the Git LFS environmentext— List the configured LFS pointer extensionsupdate— Update Git hooksmigrate— Migrate history to or from Git LFScheckout— Populate working copy with real content from Git LFS filesprune— Delete old LFS files from local storagefsck— Check Git LFS files for consistencystatus— Show the status of Git LFS files in the working treelock— Set a file as “locked” on the Git LFS serverlocks— Lists currently locked files from the Git LFS serverunlock— Remove “locked” setting for a file on the Git LFS serverls-files— Show information about Git LFS files in the index and working treelogs— Show errors logged by Git LFSmerge-driver— Merge driver for LFS-tracked files
Examples
To get started with Git LFS, the following commands can be used.
-
Setup Git LFS on your system. You only have to do this once per user account:
git lfs install -
Choose the type of files you want to track, for examples all ISO images, with git-lfs-track(1):
git lfs track "*.iso" -
The above stores this information in gitattributes(5) files, so that file needs to be added to the repository:
git add .gitattributes -
Commit, push and work with the files normally:
git add file.iso git commit -m "Add disk image" git push
Reporting bugs
This command is from the Rust implementation of git-lfs, not the original Go implementation. Please report bugs to our issue tracker.