LinuxCommandLibrary

git-lfs

Manage large file storage

TLDR

Install LFS for repo

$ git lfs install
copy
Track file pattern
$ git lfs track "*.psd"
copy
Show tracked patterns
$ git lfs track
copy
List LFS files
$ git lfs ls-files
copy
Fetch LFS objects
$ git lfs fetch
copy

SYNOPSIS

git lfs command [options]

DESCRIPTION

git lfs (Large File Storage) manages large files in Git repositories. Instead of storing large binary files directly in the repository, it replaces them with lightweight pointer files and stores the actual content on a separate LFS server.
LFS significantly reduces repository size and clone times by downloading large files only on demand. It integrates transparently with standard Git commands, so `git add`, `git commit`, and `git push` work as expected while LFS handles the content storage efficiently behind the scenes.

PARAMETERS

install

Set up LFS for repository.
track PATTERN
Track files matching pattern.
untrack PATTERN
Stop tracking pattern.
ls-files
List tracked LFS files.
fetch
Download LFS objects.
pull
Fetch and checkout LFS files.
push
Push LFS objects to remote.
--help
Display help information.

CONFIGURATION

.gitattributes

Specifies which file patterns are tracked by LFS.
$ *.psd filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
copy
.lfsconfig
Repository-specific LFS configuration including endpoint URLs.

CAVEATS

Requires LFS server support. Storage limits may apply. Some hosting has LFS quotas.

HISTORY

Git LFS was created by GitHub in 2015 with Atlassian, addressing the long-standing problem of large files in git repositories.

SEE ALSO

git(1), git-annex(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community