doc:: Git Large File Storage

安装

macOS Homebrew 方式安装:

brew install git-lfs

Linux apt 方式安装:

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
 
sudo apt-get install git-lfs

Linux yum 方式安装:

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
 
sudo yum install git-lfs

使用

安装 Git LFS 命令扩展:

git lfs install

其他命令和 Git 一致,大部分时候无须显式使用 git lfs

忽略文件

使用 --exclude 参数可以不会下载大文件,但文件对象会存在

git lfs clone --exclude="*.bin" <url>

加载 lfs 文件

# clone 单个文件
git lfs pull --include="file_name"

参考