Mercurial to Git Converter
/install hg-to-git
Mercurial to Git Converter
Convert Mercurial repositories to Git while preserving full history, branches, and tags.
Prerequisites
hg(Mercurial) installedgitinstalledhg-fast-export(auto-installed if missing)
Quick Start
# Basic conversion
hg-to-git.sh /path/to/hg-repo /path/to/git-repo
# Large repository with progress
hg-to-git-large.sh /path/to/hg-repo /path/to/git-repo
# Extract authors first (recommended)
hg-authors.sh /path/to/hg-repo authors.map
# Edit authors.map, then run conversion
Scripts
scripts/hg-to-git.sh
Standard conversion for most repositories.
Usage:
hg-to-git.sh \x3Chg-repo-path> [git-repo-path]
Features:
- Auto-installs hg-fast-export if missing
- Preserves all branches and tags
- Handles author mapping
scripts/hg-to-git-large.sh
Optimized for large repositories with progress feedback.
Usage:
hg-to-git-large.sh \x3Chg-repo-path> [git-repo-path]
Features:
- Shows progress dots during conversion
- Displays revision count upfront
- Summarizes results at end
scripts/hg-authors.sh
Extract and map Mercurial authors to Git format.
Usage:
hg-authors.sh \x3Chg-repo-path> [output-file]
Output format:
"Mercurial Author"="Git Author \x3Cemail>"
Edit the output file to fix email addresses before conversion.
Workflow
-
Extract authors (optional but recommended):
hg-authors.sh /path/to/hg-repo authors.map -
Edit author map - Update email addresses in
authors.map -
Run conversion:
hg-to-git.sh /path/to/hg-repo /path/to/git-repo -
Verify:
cd /path/to/git-repo git log --oneline -10 git branch -a git tag -l
Troubleshooting
hg-fast-export not found
The scripts auto-install from GitHub if not present in PATH.
Author mapping issues
Use hg-authors.sh to generate a mapping file, edit it, then pass to fast-export with -A authors.map.
Large repositories
Use hg-to-git-large.sh for better progress visibility.
Branches not converted
Run git branch -a in the new repo. Remote branches may need to be checked out locally.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install hg-to-git - After installation, invoke the skill by name or use
/hg-to-git - Provide required inputs per the skill's parameter spec and get structured output
What is Mercurial to Git Converter?
Convert Mercurial (hg) repositories to Git. Use when migrating from Mercurial to Git, converting hg repos to git format, preserving history and branches duri... It is an AI Agent Skill for Claude Code / OpenClaw, with 126 downloads so far.
How do I install Mercurial to Git Converter?
Run "/install hg-to-git" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Mercurial to Git Converter free?
Yes, Mercurial to Git Converter is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Mercurial to Git Converter support?
Mercurial to Git Converter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Mercurial to Git Converter?
It is built and maintained by PoeticFlowerHome (@poeticflowerhome); the current version is v1.0.0.