Fix ROOT if hg-fast-export is in PATH
[fast-export.git] / README
blob99fde49c1d6abae21b48fab9d2820c8005d9507d
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-export.sh -r <repo>
23 Please note that hg-fast-export does not automatically check out the
24 newly imported repository. You probably want to follow up the import
25 with a "git checkout"-command.
27 Incremental imports to track hg repos is supported, too.
29 Using hg-reset it is quite simple within a git repository that is
30 hg-fast-export'ed from mercurial:
32   hg-reset.sh -R <revision>
34 will give hints on which branches need adjustment for starting over
35 again.
37 As mercurial appears to be much less picky about the syntax of the
38 author information than git, an author mapping file can be given to
39 hg-fast-export to fix up malformed author strings. The file is
40 specified using the -A option. The file should contain lines of the
41 form "FromAuthor=ToAuthor". The example authors.map below will
42 translate "User <garbage<user@example.com>" to "User <user@example.com>".
44 -- Start of authors.map --
45 User <garbage<user@example.com>=User <user@example.com>
46 -- End of authors.map --
48 Notes/Limitations
49 =================
51 hg-fast-export supports multiple branches but only named branches with
52 exactly one head each. Otherwise commits to the tip of these heads
53 within the branch will get flattened into merge commits.
55 As each git-fast-import run creates a new pack file, it may be
56 required to repack the repository quite often for incremental imports
57 (especially when importing a small number of changesets per
58 incremental import).
60 The way the hg API and remote access protocol is designed it is not
61 possible to use hg-fast-export on remote repositories
62 (http/ssh). First clone the repository, then convert it.
64 Design
65 ======
67 hg-fast-export.py was designed in a way that doesn't require a 2-pass
68 mechanism or any prior repository analysis: if just feeds what it
69 finds into git-fast-import. This also implies that it heavily relies
70 on strictly linear ordering of changesets from hg, i.e. its
71 append-only storage model so that changesets hg-fast-export already
72 saw never get modified.
74 Submitting Patches
75 ==================
77 Please use the issue-tracker at github
78 https://github.com/frej/fast-export to report bugs and submit
79 patches.
81 Footnotes
82 =========
84 [0] http://www.opensource.org/licenses/mit-license.php