Skip to content

git-lfs

约 245 字小于 1 分钟

2025-02-07

Git 大文件存储 (LFS) 将音频样本、视频、数据集和图形等大文件替换为 Git 中的文本指针,同时将文件内容存储在 GitHub.com 或 GitHub Enterprise 等远程服务器上。

随着大模型参数量的不断增长,Git LFS 是一个很好的选择,可以有效地管理大文件。

使用

安装

通过 Homebrew 安装

$ brew install git-lfs
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Fetching git-lfs
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles//git-lfs-3.6.1.arm6
######################################################################### 100.0%
==> Pouring git-lfs-3.6.1.arm64_sequoia.bottle.tar.gz
==> Caveats
Update your git config to finish installation:

  # Update global git config
  $ git lfs install

  # Update system git config
  $ git lfs install --system

zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/git-lfs/3.6.1: 82 files, 13MB
==> Running `brew cleanup git-lfs`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

也可以在官网下载安装。

配置

$ git lfs install
Git LFS initialized.

参考

git-lfs

Homebrew