← 返回命令列表

Linux command

git-lfs 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Install LFS for repo

git lfs install

Track file pattern

git lfs track "*.psd"

Show tracked patterns

git lfs track

List LFS files

git lfs ls-files

Fetch LFS objects

git lfs fetch

说明

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.

参数

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.

FAQ

What is the git-lfs command used for?

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.

How do I run a basic git-lfs example?

Run `git lfs install` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does install do in git-lfs?

Set up LFS for repository.