1 hg-fast-export.(sh|py) - mercurial to git converter using git-fast-import
6 Most hg-* scripts are licensed under the MIT license[0] and were written
7 by Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and
8 #mercurial on freenode. hg-reset.py is licensed under GPLv2 since it
9 copies some code from the mercurial sources.
11 The current maintainer is Frej Drejhammar <frej.drejhammar@gmail.com>.
16 Using hg-fast-export is quite simple for a mercurial repository <repo>:
18 mkdir repo-git # or whatever
21 hg-fast-import.sh -r <repo>
23 Incremental imports to track hg repos is supported, too.
25 Using hg-reset it is quite simple within a git repository that is
26 hg-fast-export'ed from mercurial:
28 hg-reset.sh -R <revision>
30 will give hints on which branches need adjustment for starting over
36 hg-fast-import supports multiple branches but only named branches with exaclty
37 one head each. Otherwise commits to the tip of these heads within branch
38 will get flattened into merge commits.
40 As each git-fast-import run creates a new pack file, it may be required
41 to repack the repository quite often for incremental imports (especially
42 when importing a small number of changesets per incremental import).
44 The way the hg API and remote access protocol is designed it is not
45 possible to use hg-fast-export on remote repositories
46 (http/ssh). First clone the repository, then convert it.
51 hg-fast-import.py was designed in a way that doesn't require a 2-pass mechanism
52 or any prior repository analysis: if just feeds what it finds into
53 git-fast-import. This also implies that it heavily relies on strictly
54 linear ordering of changesets from hg, i.e. its append-only storage
55 model so that changesets hg-fast-import already saw never get modified.
60 [0] http://www.opensource.org/licenses/mit-license.php