1 hg2git.(sh|py) - mercurial to git converter using git-fast-import
6 The scripts are licensed under the GPL version 2 and were written by
7 Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and
8 #mercurial on freenode.
13 Using it is quite simple for a mercurial repository <repo>:
15 mkdir repo-git # or whatever
20 Incremental imports to track hg repos is supported, too.
25 hg2git supports multiple branches but only named branches with exaclty
26 one head each. Otherwise commits to the tip of these heads within branch
27 will get flattened into merge commits.
29 As each git-fast-import run creates a new pack file, it may be required
30 to repack the repository quite often for incremental imports (especially
31 when importing a small number of changesets per incremental import).
36 hg2git.py was designed in a way that doesn't require a 2-pass mechanism
37 or any prior repository analysis: if just feeds what it finds into
38 git-fast-import. This also implies that it heavily relies on strictly
39 linear ordering of changesets from hg, i.e. its append-only storage
40 model so that changesets hg2git already saw never get modified.
45 For incremental imports, handling tags needs to be reworked (maybe):
46 Right now we assume that once a tag is created, it stays forever and
47 never changes. However,
49 1) tags in hg may be removed
52 I'm not yet sure how to handle this and how this interferes with
53 non-hg-based tags in git.
55 The same for branches: They may get removed.
57 For one-time conversions, everything is fine.