# 使用 Homebrew, Nix 安装 git-trim

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

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install git-trim
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

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

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

## 软件包事实

- **软件包键:** brew:git-trim
- **软件包管理器:** Homebrew
- **版本:** 0.4.4
- **来源摘要:** Trim your git remote tracking branches that are merged or gone
- **主页:** <https://github.com/foriequal0/git-trim>
- **仓库:** <https://github.com/foriequal0/git-trim>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- git-trim (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

git-trim is a Rust Git extension for cleaning local tracking branches whose upstream branches have been merged, deleted, or left behind after pull-request work.

### 项目历史

The project appeared on GitHub in January 2020. Its README frames the tool as a safer companion to git fetch --prune, because fetch pruning removes remote-tracking refs but leaves local tracking branches for the user to inspect and delete.

The project evolved around Git workflow edge cases rather than a large feature surface. Release notes for the 0.4 series describe base-branch detection from remote HEAD refs, worktree branch preservation, richer branch classification, and detailed skip messages.

### 采用历史

Adoption followed normal Git-extension channels: GitHub release binaries, cargo install, Homebrew, and other package-manager formulas. The package fits repositories where pull-request branches accumulate faster than developers want to prune them by hand.

### 使用方式

Practitioners run git trim after reviews or after synchronizing a repository. The README recommends dry-run mode for cautious use and trim.bases configuration for workflows with base branches such as develop and master.

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

git-trim matters to package and tooling users because it turns a fragile shell one-liner into a named Git subcommand that understands merged, stray, squash-merged, rebased, and triangular-workflow branches.

### 时间线

- 2020: Repository created and 0.4 releases added workflow-oriented branch detection improvements.
- 2022: v0.4.3 release shipped dependency updates and packaged binaries.

### Related projects

- git fetch --prune, git branch --merged, git2, cargo, Homebrew

### 来源

- <https://crates.io/crates/git-trim>
- <https://formulae.brew.sh/formula/git-trim>
- <https://github.com/foriequal0/git-trim>
- <https://github.com/foriequal0/git-trim/releases>
- <https://raw.githubusercontent.com/foriequal0/git-trim/master/README.md>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Nix - git-trim: normalized package name match | nixpkgs package indexes: pkgs/by-name/gi/git-trim/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/git-trim.yml](https://github.com/mxcl/pkgdb/blob/main/combined/git-trim.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
