356ba8abf8496f4c42df4af9dace54483ceaae1a
[fast-export.git] / hg-fast-export.txt
blob356ba8abf8496f4c42df4af9dace54483ceaae1a
1 hg-fast-export.(sh|py) - mercurial to git converter using git-fast-import
3 Legal
4 =====
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>.
13 Usage
14 =====
16 Using hg-fast-export is quite simple for a mercurial repository <repo>:
18   mkdir repo-git # or whatever
19   cd repo-git
20   git init
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
31 again.
33 Notes/Limitations
34 =================
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 Design
45 ======
47 hg-fast-import.py was designed in a way that doesn't require a 2-pass mechanism
48 or any prior repository analysis: if just feeds what it finds into
49 git-fast-import. This also implies that it heavily relies on strictly
50 linear ordering of changesets from hg, i.e. its append-only storage
51 model so that changesets hg-fast-import already saw never get modified.
53 Footnotes
54 =========
56 [0] http://www.opensource.org/licenses/mit-license.php