# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop 安装 git-filter-repo

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

## 安装

```sh
sudo av install brew:git-filter-repo
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install git-filter-repo
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install git-filter-repo
```

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

### Linux

- apk (92%):

```sh
sudo apk add git-filter-repo
```

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

- Debian apt (92%):

```sh
sudo apt install git-filter-repo
```

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

- dnf (92%):

```sh
sudo dnf install git-filter-repo
```

  证据: Fedora Rawhide package metadata: git-filter-repo 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-filter-repo
```

  证据: nixpkgs package indexes: git-filter-repo from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S git-filter-repo
```

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

- zypper (92%):

```sh
sudo zypper install git-filter-repo
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/git-filter-repo
```

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

## 软件包事实

- **软件包键:** brew:git-filter-repo
- **软件包管理器:** Homebrew
- **版本:** 2.47.0
- **来源摘要:** Quickly rewrite git repository history
- **主页:** <https://github.com/newren/git-filter-repo>
- **仓库:** <https://github.com/newren/git-filter-repo>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- git-filter-repo (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

git-filter-repo is a Python-based Git history rewriting tool by Elijah Newren, positioned as a safer and faster successor to git filter-branch for repository cleanup, extraction, path rewriting, tag rewriting, and sensitive-data removal.

### 项目历史

The project grew out of Newren's work on Git fast-export and fast-import based history filtering. The public repository carries imported history back to a 2009 initial import, while the standalone GitHub project was established in 2018 and began tagging releases alongside Git 2.23-era packaging. Its README frames the tool as a response to shortcomings in git filter-branch and BFG Repo Cleaner: poor performance, confusing multi-step cleanup, limited rewrite types, and fragile shell-based filtering.

### 采用历史

Adoption was accelerated by the Git project's own filter-branch documentation, which warns against filter-branch for many use cases and points users toward git-filter-repo. The project became a standard answer for history-rewrite work because it combines a command-line interface, a Python library for custom filters, conversion guides from filter-branch and BFG, and packaging in common Unix package ecosystems.

### 使用方式

Practitioners use git-filter-repo for destructive repository rewrites: removing large blobs or secrets, extracting a subdirectory with history, moving a project into a subdirectory before a merge, renaming tags, rewriting author data with mailmap information, or replacing text across historical blobs. The tool deliberately encourages use from a fresh clone and performs cleanup steps such as pruning old history and repacking so users do not mix rewritten and original refs.

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

For package maintainers and release engineers, git-filter-repo matters because it replaced a folklore-heavy set of filter-branch recipes with a single-file script, a documented manual, and reproducible transformations. Its existence also fed changes back into core Git fast-export and fast-import behavior, making it part of the broader Git tooling ecosystem rather than only a cleanup script.

### 时间线

- 2009: Imported predecessor history begins with an initial filter-repo commit.
- 2018: The standalone GitHub repository was created.
- 2019: Git Rev News published Newren's introduction to git-filter-repo.
- Git 2.23 era: Early tagged releases appeared as the tool entered package-manager distribution.

### Related projects

- git-filter-repo is related to git filter-branch, BFG Repo Cleaner, git fast-export, git fast-import, and the filter-lamely and bfg-ish demos shipped in its contrib tree.

### 来源

- <https://git-scm.com/docs/git-filter-branch>
- <https://git.github.io/rev_news/2019/08/21/edition-54/>
- <https://github.com/newren/git-filter-repo>
- <https://github.com/newren/git-filter-repo#readme>
- <https://github.com/newren/git-filter-repo/blob/main/Documentation/git-filter-repo.txt>


## 安全说明

narrow executable package without higher-risk signals.

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

## 其他软件包管理器记录

- Debian apt - git-filter-repo - 2.47.0-2: normalized package name match | Debian stable package indexes: git-filter-repo from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Quickly rewrite git repository history | https://github.com/newren/git-filter-repo
- Nix - git-filter-repo: normalized package name match | nixpkgs package indexes: git-filter-repo from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - git-filter-repo - 2.38.0-2: normalized package name match | Ubuntu 24.04 LTS package indexes: git-filter-repo from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Quickly rewrite git repository history | https://github.com/newren/git-filter-repo
- apk - git-filter-repo - 2.47.0-r2: normalized package name match | Alpine Linux edge package indexes: git-filter-repo from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | quickly rewrite git repository history | https://github.com/newren/git-filter-repo
- apk - git-filter-repo-doc - 2.47.0-r2: normalized package name match | Alpine Linux edge package indexes: git-filter-repo-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | quickly rewrite git repository history (documentation) | https://github.com/newren/git-filter-repo
- dnf - git-filter-repo - 2.47.0-11.fc45: normalized package name match | Fedora Rawhide package metadata: git-filter-repo from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Quickly rewrite git repository history (git-filter-branch replacement) | https://github.com/newren/git-filter-repo
- pacman - git-filter-repo - 2.47.0-3: normalized package name match | Arch Linux sync databases: git-filter-repo from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Quickly rewrite git repository history (filter-branch replacement) | https://github.com/newren/git-filter-repo
- zypper - git-filter-repo - 2.47.0-2.4: normalized package name match | openSUSE Tumbleweed package metadata: git-filter-repo from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Quickly rewrite git repository history (git-filter-branch replacement) | https://github.com/newren/git-filter-repo
- MacPorts - git-filter-repo: normalized package name match | MacPorts ports tree: devel/git-filter-repo/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/git-filter-repo: normalized package name match | Scoop official bucket manifest trees: bucket/git-filter-repo.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-filter-repo.yml](https://github.com/mxcl/pkgdb/blob/main/combined/git-filter-repo.yml)


## 来源

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