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
33 As mercurial appears to be much less picky about the syntax of the
34 author information than git, an author mapping file can be given to
35 hg-fast-export to fix up malformed author strings. The file is
36 specified using the -A option. The file should contain lines of the
37 form "FromAuthor=ToAuthor". The example authors.map below will
38 translate "User <garbage<user@example.com>" to "User <user@example.com>".
40 -- Start of authors.map --
41 User <garbage<user@example.com>=User <user@example.com>
42 -- End of authors.map --
47 hg-fast-import supports multiple branches but only named branches with exaclty
48 one head each. Otherwise commits to the tip of these heads within branch
49 will get flattened into merge commits.
51 As each git-fast-import run creates a new pack file, it may be required
52 to repack the repository quite often for incremental imports (especially
53 when importing a small number of changesets per incremental import).
55 The way the hg API and remote access protocol is designed it is not
56 possible to use hg-fast-export on remote repositories
57 (http/ssh). First clone the repository, then convert it.
62 hg-fast-import.py was designed in a way that doesn't require a 2-pass mechanism
63 or any prior repository analysis: if just feeds what it finds into
64 git-fast-import. This also implies that it heavily relies on strictly
65 linear ordering of changesets from hg, i.e. its append-only storage
66 model so that changesets hg-fast-import already saw never get modified.
71 [0] http://www.opensource.org/licenses/mit-license.php