# Install git-when-merged with Homebrew, MacPorts, Nix

Find where a commit was merged in git. Version 1.2.1 via Homebrew; verified 2026-06-18.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

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

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

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

  Evidence: 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
```

  Evidence: 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

## Package facts

- **Package key:** brew:git-when-merged
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/git-when-merged>
- **Version:** 1.2.1
- **Source summary:** Find where a commit was merged in git
- **Homepage:** <https://github.com/mhagger/git-when-merged>
- **Repository:** <https://github.com/mhagger/git-when-merged>
- **Upstream docs:** <https://github.com/mhagger/git-when-merged#readme>
- **License:** GPL-2.0-only
- **Source archive:** <https://github.com/mhagger/git-when-merged/archive/refs/tags/v1.2.1.tar.gz>
- **Last updated:** 2026-06-18T09:25:51+09:00
- **Generated:** 2026-07-10T07:20:53+00:00

## Executables

- git-when-merged (cli)
- git-when-merged (alias)

## Uses from macOS

- python

## Install behavior

- Post-install hook: not defined
- Bottle: available on all

## Freshness

- Page generated: 2026-07-10
- Package-manager version: 1.2.1
- Package-manager updated: 2026-06-18
- Local data: ok
- Upstream repository: https://github.com/mhagger/git-when-merged
- Upstream latest detected: v1.2.1 (current)
## Project history and usage

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

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

- 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

### Sources

- <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>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

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

## Other Package-Manager Records

- 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


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [committed](https://www.automicvault.com/pkg/brew/committed/) - Shares av.db curated category or tags: cli, commit-history, developer-tools, version-control.
- [git-lfs](https://www.automicvault.com/pkg/brew/git-lfs/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-machete](https://www.automicvault.com/pkg/brew/git-machete/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-mediate](https://www.automicvault.com/pkg/brew/git-mediate/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-multipush](https://www.automicvault.com/pkg/brew/git-multipush/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-now](https://www.automicvault.com/pkg/brew/git-now/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-number](https://www.automicvault.com/pkg/brew/git-number/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-octopus](https://www.automicvault.com/pkg/brew/git-octopus/) - Shares av.db curated category or tags: cli, developer-tools, git-extension, version-control.
- [git-trim](https://www.automicvault.com/pkg/brew/git-trim/) - Package names and metadata indicate a similar tool family. Shared terms: cli, control, developer, developer-tools, extension.

## Combined YAML source

View the package source record on GitHub. [combined/git-when-merged.yml](https://github.com/automic-vault/db/blob/main/combined/git-when-merged.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
