# Install hg-fast-export with Homebrew

Fast Mercurial to Git converter. Version 260405 via Homebrew; verified 2026-06-18.

## Install

```sh
sudo av install brew:hg-fast-export
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install hg-fast-export
```

  Evidence: local Homebrew formula metadata

## Package facts

- **Package key:** brew:hg-fast-export
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/hg-fast-export>
- **Version:** 260405
- **Source summary:** Fast Mercurial to Git converter
- **Homepage:** <https://repo.or.cz/fast-export.git>
- **Repository:** <https://github.com/frej/fast-export>
- **Upstream docs:** <https://github.com/frej/fast-export#readme>
- **License:** GPL-2.0-or-later
- **Source archive:** <https://github.com/frej/fast-export/archive/refs/tags/v260405.tar.gz>
- **Last updated:** 2026-06-18T09:25:52+09:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- hg-fast-export.py (cli)
- hg-fast-export.sh (cli)
- hg-reset.py (cli)
- hg-reset.sh (cli)
- hg2git.py (cli)
- hg-fast-export.py (alias)
- hg-fast-export.sh (alias)
- hg-reset.py (alias)
- hg-reset.sh (alias)
- hg2git.py (alias)

## Dependencies

- mercurial
- python@3.14

## Install behavior

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

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 260405
- Package-manager updated: 2026-06-18
- Local data: ok
- Upstream repository: https://github.com/frej/fast-export
- info: No cached GitHub release or tag data was available.
## Project history and usage

hg-fast-export is a Mercurial-to-Git history converter built around Git's `git-fast-import` mechanism. It exists for projects that need to migrate Mercurial repositories into Git while preserving branches, tags, authors, commit messages, and incremental import state as far as the two systems allow.

### Project history

The project began as a set of Mercurial export scripts written by Rocco Rutte with help from Git and Mercurial community channels. The README says most `hg-*` scripts are MIT-licensed, while `hg-reset.py` is GPLv2 because it copies code from Mercurial; Frej Drejhammar is listed as the maintainer.

Its core design is intentionally streaming. The README says hg-fast-export does not require a two-pass mechanism or prior repository analysis; it feeds Mercurial changesets into `git-fast-import`, relying on Mercurial's append-only storage model and linear ordering of changesets already seen by the converter.

Over time the converter accumulated migration features around the hard parts of real repositories: author maps, branch and tag maps, default-branch renaming, non-UTF-8 metadata conversion, filename encoding overrides, content filters, Mercurial largefiles handling, Git LFS strategies, plugin hooks, and reset support for restarting from an earlier import state.

### Adoption history

hg-fast-export became one of the standard command-line answers to the Mercurial-to-Git migration problem. Its README points users to the GitHub issue tracker for support, documents Git for Windows bash as a known-working Windows environment, and notes that incremental imports are supported for tracking Mercurial repositories over time.

The package gained extra relevance during the wider migration away from Mercurial hosting toward Git hosting. The input package facts record Homebrew packaging, and the formula keeps the tool one install away for macOS and Linux users doing repository conversion work.

### How it is used

The basic workflow is to create an empty Git repository, run `hg-fast-export.sh -r <local-hg-repo>`, then check out the imported branch. The README stresses that remote Mercurial repositories must first be cloned locally because the Mercurial API and remote access protocol do not allow hg-fast-export to operate directly over HTTP or SSH.

Complex migrations often add an authors map with `-A`, branch and tag maps with `-B` and `-T`, a default-branch name with `-M`, encoding flags, content filters, or plugins. Large repositories can use the bundled Git LFS import path to write LFS pointers during conversion rather than doing a separate full history rewrite afterward.

### Why package nerds care

For package nerds, hg-fast-export is a classic migration utility: small surface, sharp edges, and deep dependence on two VCS data models. It matters because repositories are historical artifacts; preserving their history during a VCS migration is not just a one-time command, it is a careful mapping of authors, branches, tags, encodings, large files, and naming rules.

It is also notable because it wraps Git's plumbing rather than reimplementing Git storage. That keeps the tool scriptable and packageable, but makes its limitations visible: no direct remote Mercurial import, branch-name collisions, unnamed heads, case-insensitive filesystem traps, and the need for explicit mapping files in messy histories.

### Timeline

- 2000s: The project originated as Mercurial export scripts by Rocco Rutte, with community input from Git and Mercurial channels.
- 2010s: The tool became a common path for Mercurial-to-Git conversions as Git hosting grew dominant.
- 2017: Older author-map syntax was kept behind `--mappings-are-raw` for compatibility with pre-v171002 behavior.
- 2020s: The project documented Python 3.7+ and Mercurial 5.2+ requirements and added migration features for largefiles, LFS, and plugins.
- Package-manager era: Homebrew packages the converter as `hg-fast-export` with wrapper scripts such as `hg-fast-export.sh` and `hg-reset.sh`.

### Related projects

- hg-fast-export is related to Mercurial, Git, `git-fast-import`, Git LFS, hg-git, git-remote-hg, repository-host migration tooling, and batch converters such as Chris J Billington's `hg-export-tool`.

### Sources

- <https://formulae.brew.sh/formula/hg-fast-export>
- <https://github.com/frej/fast-export>
- <https://raw.githubusercontent.com/frej/fast-export/master/README.md>
- <https://repo.or.cz/w/fast-export.git>


## 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:** hg-fast-export
- **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


## 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.
- [mercurial](https://www.automicvault.com/pkg/brew/mercurial/) - Runtime dependency declared by Homebrew.
- [python@3.14](https://www.automicvault.com/pkg/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [git-cinnabar](https://www.automicvault.com/pkg/brew/git-cinnabar/) - Shares av.db curated category or tags: cli, developer-tools, git, mercurial, version-control.
- [aicommit](https://www.automicvault.com/pkg/brew/aicommit/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [aicommit2](https://www.automicvault.com/pkg/brew/aicommit2/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [aicommits](https://www.automicvault.com/pkg/brew/aicommits/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [braid](https://www.automicvault.com/pkg/brew/braid/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [cig](https://www.automicvault.com/pkg/brew/cig/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [codeberg-cli](https://www.automicvault.com/pkg/brew/codeberg-cli/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [commitizen](https://www.automicvault.com/pkg/brew/commitizen/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [topgit](https://www.automicvault.com/pkg/brew/topgit/) - Local package facts share a topical domain. Shared terms: cli, control, developer, developer-tools, git.
- [git-delete-merged-branches](https://www.automicvault.com/pkg/brew/git-delete-merged-branches/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, control, developer, developer-tools, git.
- [git-machete](https://www.automicvault.com/pkg/brew/git-machete/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, control, developer, developer-tools, git.

## Combined YAML source

View the package source record on GitHub. [combined/hg-fast-export.yml](https://github.com/automic-vault/db/blob/main/combined/hg-fast-export.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
- cross-ecosystem install command graph
