Convert Mercurial repositories to Git while preserving full history, branches, and tags.
hg (Mercurial) installedgit installedhg-fast-export (auto-installed if missing)# 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/hg-to-git.shStandard conversion for most repositories.
Usage:
hg-to-git.sh <hg-repo-path> [git-repo-path]
Features:
scripts/hg-to-git-large.shOptimized for large repositories with progress feedback.
Usage:
hg-to-git-large.sh <hg-repo-path> [git-repo-path]
Features:
scripts/hg-authors.shExtract and map Mercurial authors to Git format.
Usage:
hg-authors.sh <hg-repo-path> [output-file]
Output format:
"Mercurial Author"="Git Author <email>"
Edit the output file to fix email addresses before conversion.
```bash
hg-authors.sh /path/to/hg-repo authors.map
```
authors.map```bash
hg-to-git.sh /path/to/hg-repo /path/to/git-repo
```
```bash
cd /path/to/git-repo
git log --oneline -10
git branch -a
git tag -l
```
The scripts auto-install from GitHub if not present in PATH.
Use hg-authors.sh to generate a mapping file, edit it, then pass to fast-export with -A authors.map.
Use hg-to-git-large.sh for better progress visibility.
Run git branch -a in the new repo. Remote branches may need to be checked out locally.
共 1 个版本
暂无安全检测报告