- Add hg-git to Mercurial
- Push hg-repo to git-target
Step-by-step Guide
A Clone Hg-Git Extension from it's repository into some local PATH\TO\HG-GIT
B Enable extension in (global mercurial.ini or repository's-specific .hgrc)
[extensions]
bookmarks =
...
hggit = PATH\TO\HG-GIT
bookmark was added long time ago, when this extension wasn't part of TortoiseHG|Mercurial, not sure about today's configuration
C Create new Git-repository with read|write access to it (or remeber existing?!)
D Add Git-repo from p. C into [paths]
section of .hgrc for Mercurial repository, which you want to export in Git under any name. Sample for my local Mercurial repository, which have Git-mirror on Github
[paths]
default = git+ssh://git@github.com/lazybadger/Fiver-l10n.git
E After it you can use Git-repository as usual remote repository in Mercurial and, as fist operation (for created empty Git-repository) you have to push to your new remote
F Check existence of Git-repository with full history from Mercurial mirrored into it after push
G Use Git-repository by usual way
Sources, used in this guide
- Local Mercurial repository of WP-theme with very easy linear history
- Git-mirror of this repo on Github