<< All versions
Skill v1.0.1
currentAutomated scan100/100majiayu000/claude-skill-registry-data/mercurial-hg-majiayu000-claude-skill-registr
3 files
──Details
PublishedMay 15, 2026 at 04:23 PM
Content Hashsha256:3b010ed82a878bf0...
Git SHA01042ae58061
Bump Typepatch
──Files
Files (1 file, 3.4 KB)
SKILL.md3.4 KBactive
SKILL.md · 120 lines · 3.4 KB
version: "1.0.1" 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
bash
hg init myprojectcd myproject
Clone Existing Repository
bash
hg clone https://example.com/repo myproject
Basic Workflow
bash
# Check current statushg status# Add fileshg add file1 file2# Commit changeshg commit -m "Describe your changes"# Pull remote changeshg pull# Push local changeshg push
Common Scenarios
View History
bash
# Short historyhg log# Detailed historyhg log -v# History for specific filehg log path/to/file# Graphic historyhg log -G
Undo Operations
bash
# Revert uncommitted changeshg revert file# Revert all uncommitted changeshg 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
| Scenarios | Reference Doc | |
|---|---|---|
| Detailed basic commands, understanding file status | basics.md | |
| Create, switch, and merge branches | branches.md | |
| Complex merges, conflict resolution, rebase, histedit | advanced.md | |
| Team collaboration, code review, multi-repo management | collaboration.md | |
| Patch Queue (MQ) operations | mq.md | |
| Configure ~/.hgrc, enable extensions, custom aliases | config.md | |
| Troubleshoot common issues, recover lost commits | troubleshooting.md |
Comparison with Git
| Mercurial | Git | |
|---|---|---|
| hg commit | git commit | |
| hg pull + hg update | git pull | |
| hg push | git push | |
| hg branches | git branch -r | |
| hg bookmark | git branch | |
| hg merge | git merge | |
| hg rebase | git rebase | |
| hg share | git worktree |
Best Practices
- Check before commit: Use
hg diffandhg statusto confirm changes - Descriptive commit messages: Commit messages should clearly explain changes
- Pull frequently: Use
hg pull -uto regularly get remote updates - Use bookmarks: For branching workflows, use bookmarks instead of named branches
- Handle conflicts: When merging conflicts, carefully check each conflicted file
- 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