# 使用 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
- **软件包管理器页面:** <https://formulae.brew.sh/formula/git-trim>
- **版本:** 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>
- **许可证:** MIT
- **源码归档:** <https://github.com/foriequal0/git-trim.git>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- git-trim (cli)
- git-trim (别名)

## 依赖

- openssl@3

## 构建依赖

- pkgconf
- rust

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.4.4
- 本地数据: OK
- 上游仓库: https://github.com/foriequal0/git-trim
- 信息: No package-manager update timestamp was available.
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

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

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** git-trim
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

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

- 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


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://pkg.so/zh-hans/brew/rust/) - Build dependency declared by Homebrew.
- [git-lfs](https://pkg.so/zh-hans/brew/git-lfs/) - Shares pkgdb curated category or tags: cli, developer-tools, git-extension.
- [git-xet](https://pkg.so/zh-hans/brew/git-xet/) - Shares pkgdb curated category or tags: cli, developer-tools, git-extension.
- [git-machete](https://pkg.so/zh-hans/brew/git-machete/) - Shares pkgdb curated category or tags: cli, developer-tools, git-extension.
- [git-tools](https://pkg.so/zh-hans/brew/git-tools/) - Shares pkgdb curated category or tags: cli, developer-tools, repository-maintenance.
- [git-who](https://pkg.so/zh-hans/brew/git-who/) - Shares pkgdb curated category or tags: cli, developer-tools, git-extension.
- [git-octopus](https://pkg.so/zh-hans/brew/git-octopus/) - Shares pkgdb curated category or tags: cli, developer-tools, git-extension.
- [git-open](https://pkg.so/zh-hans/brew/git-open/) - Shares pkgdb curated category or tags: cli, developer-tools, git-extension.
- [fork-cleaner](https://pkg.so/zh-hans/brew/fork-cleaner/) - Shares pkgdb curated category or tags: cli, developer-tools, repository-maintenance.
- [git-delete-merged-branches](https://pkg.so/zh-hans/brew/git-delete-merged-branches/) - Package names and metadata indicate a similar tool family. Shared terms: branch, branches, cleanup, cli, developer.

## 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
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
