スキル一覧に戻る
yantyx

mercurial-hg

by yantyx

The skills that I use myself

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: mercurial-hg description: Comprehensive Mercurial (Hg) version control system guide covering all operations from basic to advanced. Use when Claude needs to work with Mercurial for (1) Repository initialization and cloning, (2) Basic operations (status, add, commit, pull, push), (3) Branch management and merging, (4) Advanced operations (rebase, histedit, graft), (5) Team collaboration workflows, (6) Patch queue (MQ) operations, (7) Configuration and extensions, or (8) Troubleshooting common issues.

Mercurial Hg

Mercurial is a distributed version control system (DVCS) suitable for scenarios ranging from small personal projects to large-scale enterprise projects.

Quick Start

Initialize New Repository

hg init myproject
cd myproject

Clone Existing Repository

hg clone https://example.com/repo myproject

Basic Workflow

# Check current status
hg status

# Add files
hg add file1 file2

# Commit changes
hg commit -m "Describe your changes"

# Pull remote changes
hg pull

# Rebase local changes onto the latest branch
hg rebase -d default

# If there are conflicts, resolve them, then continue
hg resolve --mark --all
hg rebase --continue

# Push specific changeset (avoid pushing all local changes)
hg push -r .

Note: Using hg push without -r will push ALL unpushed local changesets. Always use hg push -r <changeset> to push specific changes.

Common Scenarios

View History

# Short history
hg log

# Detailed history
hg log -v

# History for specific file
hg log path/to/file

# Graphic history
hg log -G

Undo Operations

# Revert uncommitted changes
hg revert file

# Revert all uncommitted changes
hg revert --all

# Backout to specific changeset (keep history)
hg backout <revision>

# Strip to specific changeset (remove history)
hg strip <revision>

When to Read Reference Documentation

ScenariosReference Doc
Detailed basic commands, understanding file statusbasics.md
Create, switch, and merge branchesbranches.md
Complex merges, conflict resolution, rebase, histeditadvanced.md
Team collaboration, code review, multi-repo managementcollaboration.md
Patch Queue (MQ) operationsmq.md
Configure ~/.hgrc, enable extensions, custom aliasesconfig.md
Troubleshoot common issues, recover lost commitstroubleshooting.md

Comparison with Git

MercurialGit
hg commitgit commit
hg pull + hg updategit pull
hg pushgit push
hg branchesgit branch -r
hg bookmarkgit branch
hg mergegit merge
hg rebasegit rebase
hg sharegit worktree

Best Practices

  1. Check before commit: Use hg diff and hg status to confirm changes
  2. Descriptive commit messages: Commit messages should clearly explain changes
  3. Pull frequently: Use hg pull -u to regularly get remote updates
  4. Use bookmarks: For branching workflows, use bookmarks instead of named branches
  5. Handle conflicts: When merging conflicts, carefully check each conflicted file
  6. Get help: For any unclear command, use hg help --verbose <command> to view official documentation

Important Concepts

  • Changeset: Basic unit of commit in Mercurial, identified by hash or revision number
  • Repository: Complete copy containing project history and current working directory
  • Working Directory: Files currently being edited
  • Tip: The latest changeset of the current branch
  • Head: A changeset with no successors

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です