← 返回 Skills 市场
poeticflowerhome

Mercurial to Git Converter

作者 PoeticFlowerHome · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
126
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hg-to-git
功能描述
Convert Mercurial (hg) repositories to Git. Use when migrating from Mercurial to Git, converting hg repos to git format, preserving history and branches duri...
使用说明 (SKILL.md)

Mercurial to Git Converter

Convert Mercurial repositories to Git while preserving full history, branches, and tags.

Prerequisites

  • hg (Mercurial) installed
  • git installed
  • hg-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

  1. Extract authors (optional but recommended):

    hg-authors.sh /path/to/hg-repo authors.map
    
  2. Edit author map - Update email addresses in authors.map

  3. Run conversion:

    hg-to-git.sh /path/to/hg-repo /path/to/git-repo
    
  4. 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.

安全使用建议
This skill looks like a legitimate Mercurial→Git conversion utility, but review these practical points before running it: 1) Back up the target path — hg-to-git-large.sh will remove an existing target directory without prompting, and hg-to-git.sh can remove it after confirming. 2) The scripts may attempt to run sudo apt-get or brew to install packages; expect prompts or permission requirements. 3) The scripts clone hg-fast-export from GitHub into your home directory (~/.local/share/hg-fast-export) — confirm you trust that upstream repo. 4) Run hg-authors.sh and manually edit the authors.map to ensure correct emails. 5) If you want to be extra cautious, inspect the three scripts locally and run them in a test environment or container before using on irreplaceable repositories.
功能分析
Type: OpenClaw Skill Name: hg-to-git Version: 1.0.0 The scripts facilitate Mercurial-to-Git migration but include high-risk behaviors such as executing 'sudo apt-get' for package installation in hg-to-git.sh and performing unconfirmed 'rm -rf' on target directories in hg-to-git-large.sh. Additionally, the scripts automatically clone and execute code from an external GitHub repository (https://github.com/frej/fast-export.git) if the required tool is missing, which introduces a supply chain risk.
能力评估
Purpose & Capability
The name/description match the provided scripts and SKILL.md. The three scripts implement author extraction and two conversion flows (standard and large). Auto-installing hg-fast-export from its upstream GitHub repo is reasonable for the stated task.
Instruction Scope
Instructions and scripts operate only on the user-supplied Mercurial repo and a target Git path and on the user's HOME for installation. They do not request unrelated credentials or external endpoints beyond cloning hg-fast-export from GitHub. Two operational notes: hg-to-git-large.sh unconditionally rm -rf the target if it exists (destructive), while hg-to-git.sh prompts before removal; both may run system package commands (sudo apt-get or brew) when attempting to install hg-fast-export.
Install Mechanism
There is no packaged install spec (instruction-only). The scripts clone hg-fast-export from https://github.com/frej/fast-export.git if missing — cloning from GitHub is expected and traceable, but it does write into the user's home (~/.local/share/hg-fast-export). Scripts also attempt apt-get/brew installs if available.
Credentials
The skill requires no credentials or special environment variables. The scripts read standard environment bits (HOME) and the repository paths supplied by the user, which is proportionate to the task.
Persistence & Privilege
always is false and the skill does not request persistent system privileges or modify other skills. It does perform local filesystem changes (cloning into ~/.local/share and creating/removing the target git repo) which are normal for this utility.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hg-to-git
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hg-to-git 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Convert hg repos to git with history preservation
元数据
Slug hg-to-git
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 126 次。

如何安装 Mercurial to Git Converter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hg-to-git」即可一键安装,无需额外配置。

Mercurial to Git Converter 是免费的吗?

是的,Mercurial to Git Converter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Mercurial to Git Converter 支持哪些平台?

Mercurial to Git Converter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Mercurial to Git Converter?

由 PoeticFlowerHome(@poeticflowerhome)开发并维护,当前版本 v1.0.0。

💬 留言讨论