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 As each git-fast-import run creates a new pack file, it may be required
26 to repack the repository quite often for incremental imports (especially
27 when importing a small number of changesets per incremental import).
32 hg2git.py was designed in a way that doesn't require a 2-pass mechanism
33 or any prior repository analysis: if just feeds what it finds into
34 git-fast-import. This also implies that it heavily relies on strictly
35 linear ordering of changesets from hg, i.e. its append-only storage
36 model so that changesets hg2git already saw never get modified.
38 Import and SHA stability
39 ========================
41 Currently it's only supported to map one hg repository to one git
42 repository. However, all forks of a hg repo can be imported into one git
43 repo each and then merged together (e.g. as different branches in the
44 final git repo) since the checksums are stable, i.e. one particular hg
45 changeset always produces the same git SHA1 checksum.
50 For incremental imports, handling tags needs to be reworked (maybe):
51 Right now we assume that once a tag is created, it stays forever and
52 never changes. However,
54 1) tags in hg may be removed
57 I'm not yet sure how to handle this and how this interferes with
58 non-hg-based tags in git.
60 The same for branches: They may get removed.
62 For one-time conversions, everything is fine.