# 使用 Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget 安装 git-lfs

查看 git-lfs 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:git-lfs
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install git-lfs
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install git-lfs
```

  证据: MacPorts ports tree: devel/git-lfs/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add git-lfs
```

  证据: Alpine Linux edge package indexes: git-lfs from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install git-lfs
```

  证据: Debian stable package indexes: git-lfs from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install git-lfs
```

  证据: Fedora Rawhide package metadata: git-lfs from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#git-lfs
```

  证据: nixpkgs package indexes: pkgs/by-name/gi/git-lfs/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S git-lfs
```

  证据: Arch Linux sync databases: git-lfs from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install git-lfs
```

  证据: openSUSE Tumbleweed package metadata: git-lfs from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install git-lfs
```

  证据: Chocolatey community package catalog: git-lfs from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','fusioninventory-agent'

- Scoop (92%):

```sh
scoop install main/git-lfs
```

  证据: Scoop official bucket manifest trees: bucket/git-lfs.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id GitHub.GitLFS -e
```

  证据: Windows Package Manager source index: GitHub.GitLFS from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:git-lfs
- **软件包管理器:** Homebrew
- **版本:** 3.7.1
- **来源摘要:** Git extension for versioning large files
- **主页:** <https://git-lfs.com/>
- **仓库:** <https://github.com/git-lfs/git-lfs>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- git-lfs (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 3.7.1
## 项目历史与用法

Git LFS is the reference command-line implementation and specification for storing large file contents outside ordinary Git blobs while keeping small pointer files in the repository. It became one of the standard answers for repositories that need to version art assets, datasets, media, archives, and other large binaries without making every clone carry every large object as normal Git history.

### 项目历史

The public git-lfs repository was created in 2013, and the changelog records v0.5.0 in April 2015 as the initial public release. The official specification preserves a clue from the pre-release era by documenting legacy pointer files that used a `hawser.github.com` version URL before the `git-lfs.github.com/spec/v1` pointer URL.

Git LFS reached v1.0.0 in October 2015. Before that milestone, v0.6.0 switched the client to the Batch API by default while retaining fallback to the legacy API. The 2.x line later removed old APIs and added features such as `git lfs migrate`, which rewrites history to convert large Git blobs into LFS objects.

### 采用历史

Git LFS matters because it is both a Git extension and a protocol/specification surface. The README describes pre-built binaries for macOS, Windows, Linux, and FreeBSD, Homebrew installation, Debian and RPM packages, Chocolatey installation, and inclusion in Git for Windows. That distribution footprint helped make LFS available to designers, game teams, data projects, and software teams using hosted Git services.

The project also has a maintainer model around a core team and alumni, public releases with signed hashes, official command documentation, an FAQ, and implementation notes. Those are signs of infrastructure-level Git tooling rather than a one-off helper script.

### 使用方式

Practitioners run `git lfs install` once to configure clean and smudge filters, use `git lfs track` to add patterns to `.gitattributes`, commit that attributes file, and then add and push files as usual. Git LFS writes pointer files into Git and stores object contents under the LFS object store, uploading LFS objects before the Git push completes.

`git lfs migrate` is used when large files already exist in history and need to be moved into LFS, with the usual history-rewrite consequences. Operators also use `git lfs env`, tracing, signed release verification, and the command manpages when debugging installs or server interactions.

### 为什么软件包爱好者会关心

Git LFS is package-nerd significant because it is a CLI, a Git filter integration, and a wire-format specification in one package. It shows how a package can become part of the developer-tooling substrate: package managers distribute the binary, Git invokes it through filters and hooks, and hosting platforms implement the matching storage API.

### 时间线

- 2013: Public GitHub repository created.
- 2015: v0.5.0 marked the initial public release.
- 2015: v0.6.0 used the Batch API by default.
- 2015: v1.0.0 released.
- 2017: v2.0.0 removed legacy APIs.
- 2017: v2.2.0 added `git lfs migrate`.

### Related projects

- Git LFS relates to Git attributes, clean and smudge filters, Git for Windows, and hosted Git LFS server implementations. Its problem space overlaps with artifact repositories and data-versioning tools, but its distinctive feature is that ordinary Git commits retain pointer files while large object transfer is handled out of band.

### 来源

- <https://api.github.com/repos/git-lfs/git-lfs>
- <https://git-lfs.com/>
- <https://github.com/git-lfs/git-lfs#readme>
- <https://github.com/git-lfs/git-lfs/blob/main/CHANGELOG.md>
- <https://github.com/git-lfs/git-lfs/blob/main/docs/spec.md>
- <https://github.com/git-lfs/git-lfs/tree/main/docs>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .lfsconfig, .gitattributes, .git/config, ~/.gitconfig, /etc/gitconfig
## 其他软件包管理器记录

- Debian apt - git-lfs - 3.6.1-1+deb13u1: normalized package name match | Debian stable package indexes: git-lfs from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Git Large File Support | https://git-lfs.github.com/
- Debian apt - golang-github-git-lfs-git-lfs-dev - 3.6.1-1+deb13u1: normalized package name match | Debian stable package indexes: golang-github-git-lfs-git-lfs-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Git Large File Support (library) | https://git-lfs.github.com/
- Nix - git-lfs: normalized package name match | nixpkgs package indexes: pkgs/by-name/gi/git-lfs/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - git-lfs - 3.4.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: git-lfs from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Git Large File Support | https://git-lfs.github.com/
- Ubuntu apt - golang-github-git-lfs-git-lfs-dev - 3.4.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: golang-github-git-lfs-git-lfs-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Git Large File Support (library) | https://git-lfs.github.com/
- apk - git-lfs - 3.7.1-r1: normalized package name match | Alpine Linux edge package indexes: git-lfs from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Git extension for versioning large files | https://git-lfs.github.io/
- apk - git-lfs-bash-completion - 3.7.1-r1: normalized package name match | Alpine Linux edge package indexes: git-lfs-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for git-lfs | https://git-lfs.github.io/
- apk - git-lfs-doc - 3.7.1-r1: normalized package name match | Alpine Linux edge package indexes: git-lfs-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Git extension for versioning large files (documentation) | https://git-lfs.github.io/
- apk - git-lfs-fish-completion - 3.7.1-r1: normalized package name match | Alpine Linux edge package indexes: git-lfs-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for git-lfs | https://git-lfs.github.io/
- apk - git-lfs-zsh-completion - 3.7.1-r1: normalized package name match | Alpine Linux edge package indexes: git-lfs-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for git-lfs | https://git-lfs.github.io/
- dnf - git-lfs - 3.7.1-4.fc44: normalized package name match | Fedora Rawhide package metadata: git-lfs from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Git extension for versioning large files | https://git-lfs.github.io/
- pacman - git-lfs - 3.7.1-1: normalized package name match | Arch Linux sync databases: git-lfs from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Git extension for versioning large files | https://git-lfs.github.com
- zypper - git-lfs - 3.7.1-1.8: normalized package name match | openSUSE Tumbleweed package metadata: git-lfs from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Git extension for versioning large files | https://github.com/git-lfs/git-lfs
- MacPorts - git-lfs: normalized package name match | MacPorts ports tree: devel/git-lfs/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - git-lfs: normalized package name match | Chocolatey community package catalog: git-lfs from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','fusioninventory-agent'
- Scoop - main/git-lfs: normalized package name match | Scoop official bucket manifest trees: bucket/git-lfs.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/git-lfs.yml](https://github.com/mxcl/pkgdb/blob/main/combined/git-lfs.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
