# 使用 Homebrew, MacPorts, Nix 安装 git-when-merged

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

## 安装

```sh
sudo av install brew:git-when-merged
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install git-when-merged
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install git-when-merged
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#git-when-merged
```

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

## 软件包事实

- **软件包键:** brew:git-when-merged
- **软件包管理器:** Homebrew
- **版本:** 1.2.1
- **来源摘要:** Find where a commit was merged in git
- **主页:** <https://github.com/mhagger/git-when-merged>
- **仓库:** <https://github.com/mhagger/git-when-merged>
- **最后更新:** 2026-06-18T09:25:51+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- git-when-merged (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

git-when-merged is a Python Git extension that finds the merge commit that first brought a given commit into a branch.

### 项目历史

Michael Haggerty created the repository in February 2013. The README says the command was originally based on a Stack Overflow suggestion for finding the merge commit that included a specific commit.

The project grew around Git-history forensics. The 2016 releases added recursive merge tracing, log output, commit-only output, branch display, and describe-based options. A 2022 release added the packaging work needed for PyPI distribution.

### 采用历史

The README documents several installation paths: pipx from PyPI, a local virtual environment, cloning the repository onto PATH, and Homebrew for macOS users. Package-manager metadata also lists distribution through Homebrew, MacPorts, and Nix.

### 使用方式

Practitioners use git when-merged during code archaeology, release maintenance, and regression tracking. It walks first-parent history to answer when and why a commit entered a branch, with options to show logs, diffs, merge ranges, patterns, and configured reference groups.

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

The tool is a package-nerd favorite because it wraps a subtle Git graph question in a memorable subcommand, making first-parent merge analysis scriptable and repeatable.

### 时间线

- 2013: Repository created.
- 2016: v1.1 and v1.2 releases expanded merge-analysis options.
- 2022: v1.2.1 added PyPI release packaging.

### Related projects

- git log --first-parent, git describe, pipx, PyPI, Homebrew

### 来源

- <https://formulae.brew.sh/formula/git-when-merged>
- <https://github.com/mhagger/git-when-merged>
- <https://github.com/mhagger/git-when-merged/releases>
- <https://pypi.org/project/git-when-merged>
- <https://raw.githubusercontent.com/mhagger/git-when-merged/master/README.md>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Nix - git-when-merged: normalized package name match | nixpkgs package indexes: pkgs/by-name/gi/git-when-merged/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - git-when-merged: normalized package name match | MacPorts ports tree: devel/git-when-merged/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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